2016-12-14 77 views
0

我有一個使用Entity Framework Core 1.1和SQLite的UWP應用程序。當我在調試模式下運行應用程序時,一切正常。但是當我使用.net native編譯爲發行版時,它會與空指針一起崩潰。 在我得到這個輸出:使用.net編譯時,實體框架Core 1.1崩潰

Exception thrown: 'SQLite.SQLiteException' in SQLite-net.dll 
Exception thrown: 'System.ArgumentNullException' in System.Linq.Expressions.dll 
Exception thrown: 'System.ArgumentNullException' in System.Private.CoreLib.dll 
An exception of type 'System.ArgumentNullException' occurred in System.Private.CoreLib.dll but was not handled in user code 
Additional information: ArgumentNull_Generic 

enter image description here

我看到誰了ARM的設備類似的東西在GitHub上的問題,但我有我所有的設備,包括我的筆記本電腦。我嘗試將條目設置爲rd.xaml,以解決GitHub問題中推薦的問題。但隨着項目我做它沒有工作,要麼:

<Assembly Name="Microsoft.EntityFrameworkCore.Sqlite" DoNotOptimize="true" DoNotInline="true" /> 

我使用這些包:

"Microsoft.EntityFrameworkCore.Sqlite": "1.1.0", 
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final", 

回答

0

EF核心與UWP沒有準備好黃金時間尚未..

從:https://github.com/aspnet/EntityFramework/wiki/Roadmap

「通用Windows平臺(UWP)當前適用於本地開發,但是EF和.NET Native團隊工作的.NET Native工具鏈存在問題克去解決。「

+1

那麼,如果不是在UWP那麼它在哪裏.. ^^ – NPadrutt

+1

更新了我的回覆 – ErikEJ

+1

感謝您的鏈接。這很有趣。我刪除了標誌以包含運行時到包中,以便使用共享並且現在似乎工作。至少在Release配置中。我正在嘗試在我的測試版中創建一個發佈版本。 – NPadrutt