【问题标题】:Unclear Sqlite exception after updating my UWP app更新我的 UWP 应用后不清楚 Sqlite 异常
【发布时间】:2018-05-24 01:00:23
【问题描述】:

更新 UWP 应用程序后,我从应用程序的不同部分收到许多崩溃

STOWED_EXCEPTION_Microsoft.Data.Sqlite.SqliteException_80131500***APP-NAME***.dll!Microsoft::Data::Sqlite::SqliteCommand.ExecuteReader

这在以前的版本中没有发生,我也没有更改数据库访问代码部分,也没有更新/重新安装 EF Sqlite nugget 包。 以下是我从用户那里收到的 Stacktrace:

谢谢

Frame   Image   Function    Offset

0 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::Interop::MarshalEx.ThrowExceptionForRC 0x0000000000000067
1 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::SqliteCommand.ExecuteReader 0x000000000000012F
2 Microsoft.Data.Sqlite.dll Microsoft::Data::Sqlite::SqliteCommand.ExecuteDbDataReader 0x000000000000000B
3 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand::__c__DisplayClass17_0._ExecuteReader_b__0$catch$0 0x0000000000000013
4 SharedLibrary.dll System::Func$1_System::__Canon_.Invoke 0x0000000000000013
5 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand.Execute_System.__Canon_$catch$0 0x00000000000000C1
6 EntityFramework.Relational.dll Microsoft::Data::Entity::Storage::Internal::RelationalCommand.ExecuteReader 0x0000000000000057
7 EntityFramework.Relational.dll Microsoft::Data::Entity::Query::Internal::QueryingEnumerable::Enumerator.MoveNext 0x000000000000008B
8 EntityFramework.Relational.dll Microsoft::Data::Entity::Query::QueryMethodProvider.GetResult_System.Int32_ 0x000000000000003D
9 APPNAME.McgInterop.dll _$ILCT$::$ILT$ReflectionDynamicInvoke$.InvokeRetOI_System.__Canon,System.Int32 0x0000000000000061
10 SharedLibrary.dll System::InvokeUtils.CallIHelperStaticCallWithInstantiation 0x0000000000000023
11 SharedLibrary.dll System::InvokeUtils.CallDynamicInvokeMethod 0x0000000000000119
12 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.InvokeWorker$catch$0 0x0000000000000017
13 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.Invoke 0x0000000000000009
14 System.Linq.Expressions System::Linq::Expressions::Interpreter::MethodInfoCallInstruction.Run 0x0000000000000065
15 System.Linq.Expressions System::Linq::Expressions::Interpreter::Interpreter.Run 0x0000000000000027
16 System.Linq.Expressions System::Linq::Expressions::Interpreter::LightLambda.Run 0x000000000000009B
17 SharedLibrary.dll System::Runtime::CompilerServices::ConditionalWeakTable$2_System::__Canon,System::__Canon_::CreateValueCallback.InvokeObjectArrayThunk 0x0000000000000037
18 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::QueryCompiler::__c__DisplayClass18_1$1_System::Int32_._CompileQuery_b__1$catch$0 0x0000000000000059
19 SharedLibrary.dll System::Comparison$1_System::__Canon_.Invoke 0x0000000000000013
20 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::QueryCompiler.Execute_System.Int32_ 0x000000000000003D
21 EntityFramework.Core.dll Microsoft::Data::Entity::Query::Internal::EntityQueryProvider.Execute_System.Int32_ 0x0000000000000033
22 System.Linq.Queryable.dll System::Linq::Queryable.Count_System.Int32_ 0x0000000000000121
23 APPNAME*.exe InstagramDownloader::pgHome._imgDownloader_b__15_4 0x0000000000000167
24 APPNAME*.McgInterop.dll Windows::System::Threading::TimerElapsedHandler.Invoke 0x000000000000000F
25 APPNAME*.McgInterop.dll McgInterop::ReverseComSharedStubs.Proc_ 0x0000000000000015
26 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
27 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ThrowForNonSuccess 0x0000000000000053
28 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.HandleNonSuccessAndDebuggerNotification 0x000000000000002D
29 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ValidateEnd 0x000000000000001D
30 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.GetResult 0x000000000000000B
31 APPNAME*.exe InstagramDownloader::pgHome::_imgDownloader_d__15.MoveNext 0x00000000000015AF
32 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
33 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ThrowForNonSuccess 0x0000000000000053
34 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.HandleNonSuccessAndDebuggerNotification 0x000000000000002D
35 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.ValidateEnd 0x000000000000001D
36 System.Private.Threading System::Runtime::CompilerServices::TaskAwaiter.GetResult 0x000000000000000B
37 APPNAME*.exe InstagramDownloader::pgHome::_btnDownload_Click_d__17.MoveNext 0x000000000000025D
38 APPNAME*.McgInterop.dll McgInterop::McgHelpers.ThrowFailed 0x0000000000000033
39 APPNAME*.McgInterop.dll McgInterop::ComCallHelpers.ComCall__HRESULT 0x00000000000000A9
40 APPNAME*.McgInterop.dll McgInterop::ForwardComSharedStubs.Func_TResult___System.__Canon,_System.__Canon_0x000000000000002B
41 APPNAME*.McgInterop.dll Windows::UI::Popups::MessageDialog.ShowAsync 0x0000000000000011
42 APPNAME*.exe InstagramDownloader::pgHome::_btnDownload_Click_d__17.MoveNext$catch$0 0x000000000000002F
43 SharedLibrary.dll System::Runtime::ExceptionServices::ExceptionDispatchInfo.Throw 0x0000000000000019
44 System.Private.Threading System::Runtime::CompilerServices::AsyncMethodBuilderCore::__c._ThrowAsync_b__9_0 0x0000000000000013
45 System.Private.Threading System::Threading::WinRTSynchronizationContext::Invoker.InvokeCore 0x0000000000000033

【问题讨论】:

    标签: c# entity-framework linq sqlite uwp


    【解决方案1】:

    我建议更新 NuGet 上所有与 SQLite 相关的包以及 Visual Studio 的 SQLite 扩展(通过工具 -> 扩展和更新...)

    更新

    据我所知,您使用 EntityFrameworkCore,它仅适用于 Windows 10 Fall Creators Update 及更新版本,不适用于旧版本的 UWP。要解决这些问题,您必须将您的应用设置为具有最低 SDK 版本 16299 (FC​​U)。如果你需要支持旧版本,你现在必须在没有实体框架的情况下工作......

    【讨论】:

    • 没有更新。我正在使用“EntityFramework.Sqlite”link nugget pkg 通过 EF 访问 Sqlite 数据库,但我现在找不到这个预发布包的新版本,我也找不到适用于我的 uwp 应用程序的合适包最低版本目标(10.0.10586)构建,不幸的是本文仅适用于秋季创作者更新link
    • 安装和使用这个包的低版本(EntityFrameworkCore)是否解决了问题?我安装的不是新版本,而是 1.4.1 版本(当前版本 10.0.15063)一切似乎都可以正常工作,但我不确定是否适用于像 10.0.1586 这样的旧 Windows 版本。
    • 恐怕不行。据我所知,旧版本仍需要 Fall Creators Update 才能正常工作。
    猜你喜欢
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    • 2021-04-16
    • 1970-01-01
    • 2018-01-19
    • 1970-01-01
    • 2013-01-27
    • 1970-01-01
    相关资源
    最近更新 更多