我正在尝试使用Azure Mobile SQLiteStore包编写UWP Xamarin.Forms应用程序。但我遇到了该软件包的依赖项SQLitePCL的问题。
在我的UWP项目中,我引用了适用于通用Windows平台的SQLite扩展,以及它的依赖项Microsoft.VCLibs。 错误信息是:无法加载DLL“sqlite3.dll”:找不到指定的模块。(来自HRESULT的异常:0x8007007E)
安卓应用程序运行良好,只有UWP出现问题,一旦开始调用SQLite就会崩溃。
以下是堆栈跟踪信息:
在我的UWP项目中,我引用了适用于通用Windows平台的SQLite扩展,以及它的依赖项Microsoft.VCLibs。 错误信息是:无法加载DLL“sqlite3.dll”:找不到指定的模块。(来自HRESULT的异常:0x8007007E)
安卓应用程序运行良好,只有UWP出现问题,一旦开始调用SQLite就会崩溃。
以下是堆栈跟踪信息:
at SQLitePCL.SQLiteConnection.SetTemporaryDirectory()
at SQLitePCL.SQLiteConnection..ctor(String fileName, SQLiteOpen openFlag, Boolean setTemporaryDirectory)
at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore..ctor(String fileName)
at WellDoneIt.Services.WellDoneItMobileService.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WellDoneIt.Services.WellDoneItMobileService.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WellDoneIt.ViewModel.ListViewModel.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at WellDoneIt.ViewModel.ListViewModel.<<-ctor>b__2_2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()
有人知道如何解决这个问题吗?
更新:我还仔细检查了处理器架构,模拟器设置为x86,真实的Win10移动设备设置为ARM。
在两者上都遇到了完全相同的问题。但是当我在本地机器上运行我的应用程序(我开发Windows 10操作系统的机器)时,一切正常。
提前致谢。