我正在使用 Xamarin.Forms 开发 native 应用程序。但是我现在面临的问题与Xamarin无关。我通过
添加了新的 Windows Phone 项目右键单击 > 添加 > 新建项目 -> Windows Phone 应用程序 -> 空白应用程序(Windows Phone)。
在 Visual Studio premium 2013 中我现有的 Xamarin 项目中。我正在使用 sqlitenet pcl 进行数据库连接。我的项目中有以下代码。
public ISQLitePlatform CreateSqlitePlatformInterface()
{
return new SQLitePlatformWinRT();
}
当它在上面执行时,它会抛出异常
An exception of type 'System.DllNotFoundException' occurred in SQLite.Net.Platform.WinRT.DLL but was not handled in user code
Additional information: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
这个问题已经被问过很多次了,我尝试了所有建议的解决方案,但我仍然无法修复它。
我的 Packages.config
<package id="SQLite.Net-PCL" version="3.0.5" targetFramework="wpa81" />
<package id="Sqlite-Winrt" version="3.8.7.1" targetFramework="wpa81" />
<package id="Xamarin.Forms" version="1.4.2.6359" targetFramework="wpa81" />
以上是我从Nuget下载的包。我错过了什么吗?我还需要添加什么?
我也试过:
- 从 Sqlite 下载 sqlite-winrt81-3081002.vsix下载 页面。
- 从 x86 复制了 sqlite3.dll。
- 尝试将其粘贴到我的bin 文件夹以及我的项目 root 并将其内容更改为 总是复制。 ( ref: https://stackoverflow.com/questions/4744293/unable-to-load-dll-sqlite3-the-specified-module-could-not-be-found-exceptio )
- 我的项目针对 x86 而不是任何 CPU。
我的项目引用:
最佳答案
安装 SQLite Visual Studio Extension 后,您需要在 Windows/Extensions 下的 Reference Manager 中添加对 SQLite for Windows Runtime
的引用。
关于c# - 无法在 SQLite Net Platform WinRT 中加载 DLL 'sqlite3',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31042772/