我正在尝试使用 Azure Mobile SQLiteStore 为 UWP Xamarin.Forms 编写应用程序包裹。
我与 SQLitePCL 包作斗争,它是上述包的依赖项。
在我的 UWP 项目中,我引用了通用 Windows 平台的扩展 SQLite,它的依赖项 Microsoft.VCLibs
错误是:无法加载DLL“sqlite3.dll”:找不到指定的模块。 (HRESULT 异常:0x8007007E)
Android 应用程序工作正常,只有 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 操作系统)上运行我的应用程序时,一切正常。
提前致谢。
最佳答案
您需要添加对 Windows 平台 SQLite 的引用。
在您的 UWP 项目中,转到“添加引用”。
转到通用 Windows > 扩展
然后确保勾选 SQLite for Universal App Platform
关于sqlite - 无法加载 DLL 'sqlite3.dll' : The specified module could not be found in UWP Xamarin. 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36521860/