sqlite - 无法加载 DLL 'sqlite3.dll' : The specified module could not be found in UWP Xamarin. 表单

标签 sqlite azure win-universal-app xamarin.forms azure-mobile-services

我正在尝试使用 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/

相关文章:

android - 如何在 android 上将 WHERE 子句添加到查询

sql - SQL查询麻烦SQLite

c# - 具有值和文本的 ComboBoxItem

c# - WebView - 在每个请求上定义 User-Agent

缺少 MemoryMappedFiles 的 C# UWP Windows 10 进程间通信

java - 为什么我的数据库Adapter类更新方法返回0?

azure - 数据工厂定价中的数据流

python - 如何将Python连接到SQL Azure?

azure - 清理 Azure Web 作业中的日志

node.js - 类型错误 : stream is undefined