无法加载 DLL 'sqlite3' - 对于 Windows Universal Mobile

2024-03-23

我使用带有 SP2 的 Visual Studio 2015。我尝试使用 sqlite 创建 Windows 通用应用程序。我添加了适用于通用 Windows 平台的 SQLite 和 SQLite.Net-PCl。这是我的简单代码

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 https://stackoverflow.com/questions/31851012/unable-to-load-dll-sqlite3-in-universal-windows-app-running-on-mobile。我安装 SQLite for Universal Windows Platform 扩展和 SQLite.Net-PCl。我创建了清晰的项目。但这对我不起作用。


我添加了对通用 Windows 平台应用程序的 Visual C++ 2015 运行时的引用。这对我来说是工作。我使用 SQLite 作为通用 Windows 平台。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法加载 DLL 'sqlite3' - 对于 Windows Universal Mobile 的相关文章

随机推荐