本文介绍了无法加载 DLL 'sqlite3' - 适用于 Windows Universal Mobile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I used Visual Studio 2015 with SP2. I try created Windows Universal app with sqlite. I added SQLite for Unversal Windows Platforms and SQLite.Net-PCl. It is my simple code

var conn = new SQLiteConnection(
            new SQLitePlatformWinRT(),
            Path.Combine(ApplicationData.Current.LocalFolder.Path,  "Storage.sqlite"));

它适用于桌面.但它不适用于移动设备(在设备和模拟器中).我收到这个异常 System.DllNotFoundException:

It is working for desktop. But it is not work for mobile(in device and emulator). I get this exception 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()

我试试这个方法.我为通用 Windows 平台扩展和 SQLite.Net-PCl 重新安装了 SQLite.我创建了清晰的项目.但它对我不起作用.

I try this method. I reinstall SQLite for Unversal Windows Platforms extension and SQLite.Net-PCl. I created clear project. But it does not work for me.

推荐答案

我添加了对 Visual C++ 2015 Runtime for Universal Windows Platform Apps 的引用.这对我来说是工作.我将 SQLite 用于通用 Windows 平台.

I add a reference to Visual C++ 2015 Runtime for Universal Windows Platform Apps. It is work for me. I used SQLite for Universal Windows Platform.

这篇关于无法加载 DLL 'sqlite3' - 适用于 Windows Universal Mobile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:45