2017-02-20 52 views
0

我正在C#UWP项目的Windows 10桌面应用程序, 所有SQLite的。在Windows运行时和Windows类库中实现的功能,然后将Windows运行时引用附加到Win Js项目可以正常工作。当我试图调用这些方法创建一个数据库,记录插入JavaScript应用程序得到以下错误:无法加载文件或程序集SQLite.Net,版本= 3.1.0.0

System.IO.FileNotFoundException: Could not load file or assembly 'SQLite.Net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

enter image description here

回答

1

我猜你正在使用SQLite.Net-PCL。如果是这样,您需要安装SQLite support for UWP。您可以通过的This Page部分找到它。

重新安装Vsix文件后,重新启动您的visual studio并在add reference->Universal Windows->Extensions->SQLite for Universal Windows Platform处添加对RuntimeComponent的引用。

如果问题仍然存在,您可以尝试删除nuget包并直接添加dll引用。有两个DLL需要引用。你可以找到他们下:

  1. C:\Users\<username>\.nuget\packages\SQLite.Net.Core-PCL\3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll

  2. C:\Users\v-xucxia.FAREAST\.nuget\packages\SQLite.Net-PCL\3.1.1\lib\portable-win81+wpa81\SQLite.Net.Platform.WinRT.dll

+0

谢谢你,猫王,是我使用SQLite.Net-PCL我不与第一过程中,我试图尝试第二个过程终于可以正常工作了 –

相关问题