Fet*_*mos 3 sqlite windows-phone sqlite-net win-universal-app visual-studio-2015
我使用Visual Studio 2015 SP2.我尝试使用sqlite创建Windows Universal应用程序.我为Unversal Windows平台和SQLite.Net-PCl添加了SQLite.这是我简单的代码
var conn = new SQLiteConnection(
new SQLitePlatformWinRT(),
Path.Combine(ApplicationData.Current.LocalFolder.Path, "Storage.sqlite"));
Run Code Online (Sandbox Code Playgroud)
它适用于桌面.但它不适用于移动设备(在设备和模拟器中).我得到这个异常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()
Run Code Online (Sandbox Code Playgroud)
我尝试这种方法.我重新安装SQLite for Unversal Windows Platforms扩展和SQLite.Net-PCl.我创建了明确的项目.但它对我不起作用.
小智 5
确保您当前添加2个引用
它仍然有效!