【发布时间】:2020-07-31 18:23:30
【问题描述】:
我在我的xamarin-forms 应用程序中使用微软ef-core 和Sqlite 数据库。我的模型很大,所以我想把它放在这里不是一个好主意。我在该应用程序上工作了几周,并在我的手机上以 Debug 模式进行了测试 - 一切正常。
但是,一旦我构建了 RELEASE 版本 - 我就在 DbContext.EnsureCreated() 调用时得到了 ArgumentNullException。我可以使用控制台输出找到它。所以它说:
Value cannot be null. Parameter name: key
在 DEBUG 构建时,我的应用程序运行良好,而且我的代码中也没有依赖于构建的预编译器指令。使用 Visual Studio 2017
关于我可以检查什么的任何想法或建议?
UPD:这是我在 Release 中获得的堆栈跟踪:
I/mono-stdout(24851): TRACE: at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x00008] in <d029cac6f9824b0bb72d5eb6d48d11f3>:0
I/mono-stdout(24851): at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <d029cac6f9824b0bb72d5eb6d48d11f3>:0
I/mono-stdout(24851): at Microsoft.EntityFrameworkCore.Sqlite.Query.Internal.SqliteDateTimeAddTranslator..ctor (Microsoft.EntityFrameworkCore.Query.ISqlExpressionFactory sqlExpressionFactory) [0x000c5] in <7b7aa88a95d54aa786bada86edd4821a>:0
I/mono-stdout(24851): at Microsoft.EntityFrameworkCore.Sqlite.Query.Internal.SqliteMethodCallTranslatorProvider..ctor (Microsoft.EntityFrameworkCore.Query.RelationalMethodCallTranslatorProviderDependencies dependencies) [0x0001d] in <7b7aa88a95d54aa786bada86edd4821a>:0
I/mono-stdout(24851): at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
I/mono-stdout(24851): at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in <d029cac6f9824b0bb72d5eb6d48d11f3>:0
【问题讨论】:
标签: sqlite xamarin.forms entity-framework-core