sqlite实现中的xamarin.forms中的FileNotFoundException

时间:2015-03-24 08:48:47

标签: sqlite xamarin.forms

在我使用sqlite的项目中,我收到此错误。

System.IO.FileNotFoundException occurred in SQLite.Net.Platform.WindowsPhone8.DLL but was not handled in user code

类型的例外情况

这是截图。

enter image description here

P.S。我在变量路径中获得了值C:\ Data \ Users \ DefApps \ AppData {F8267584-1051-4816-8195-EE018BA5155E} \ local \ Student.db3

由于

1 个答案:

答案 0 :(得分:6)

您缺少Windows Phone的Sqlite。 iOS和Android都有Sqlite"内置",这意味着它可以直接在平台上使用。 Windows Phone没有Sqlite。

要添加它,首先使用工具 - >准备您的开发机器。 Visual Studio中的扩展和更新。在线搜索" sqlite windows phone"。您必须为WP8安装一个(而不是8.1)。完成后,您的计算机就可以使用WP项目部署Sqlite了。

Sqlite extension

接下来,向您的WP应用添加对Sqlite的引用。右键单击WP项目中的引用。选择添加参考,然后在菜单中选择 Windows Phone SDK - >扩展程序并选择 Sqlite for Windows Phone

reference Sqlite