【发布时间】:2016-04-01 07:47:55
【问题描述】:
我使用带有 SP2 的 Visual Studio 2015。我尝试使用 sqlite 创建 Windows 通用应用程序。我为 Unversal Windows Platforms 和 SQLite.Net-PCl 添加了 SQLite。这是我的简单代码
var conn = new SQLiteConnection(
new SQLitePlatformWinRT(),
Path.Combine(ApplicationData.Current.LocalFolder.Path, "Storage.sqlite"));
它适用于桌面。但它不适用于移动设备(在设备和模拟器中)。我得到这个异常 System.DllNotFoundException:
HResult=-2146233052
Message=Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=SQLite.Net.Platform.WinRT
TypeName=""
StackTrace:
at SQLite.Net.Platform.WinRT.SQLite3.SetDirectory(UInt32 directoryType, String directoryPath)
at SQLite.Net.Platform.WinRT.SQLiteApiWinRT..ctor()
at SQLite.Net.Platform.WinRT.SQLitePlatformWinRT..ctor()
at AppDbTest.MainPage.DbConnection()
at AppDbTest.MainPage..ctor()
at AppDbTest.AppDbTest_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_MainPage()
at AppDbTest.AppDbTest_XamlTypeInfo.XamlUserType.ActivateInstance()
我试试这个method。我为 Unversal Windows Platforms 扩展和 SQLite.Net-PCl 重新安装了 SQLite。我创建了清晰的项目。但这对我不起作用。
【问题讨论】:
-
您是否尝试为新的 sqlite 版本更新您的 nuget 包?
-
我使用 SQLite.Net-PCL 3.1.1 和 SQLite.Net.Async-PCL 3.1.1。这是最后一个版本。
-
对于 SQLite.Net.Async-PCL,我正在使用 3.0.5,因为 3.1.1 在我的项目中弹出了一些错误,除了我的项目在所有三个桌面、移动设备和模拟器上都可以正常工作。它是仅在当前项目中发生还是在所有其他项目中发生?
-
第一个工作项目中的这个问题。我创建了清晰的 Windows 通用项目 - 但我有这个问题
-
由于问题可能出在您当前的工作环境中,或者您已经参考了一些参考资料,您能否分享一个具有相同错误的示例应用程序。
标签: sqlite visual-studio-2015 windows-phone win-universal-app sqlite-net