sqlite - SQLite 实现中 xamarin.forms 中的 FileNotFoundException

标签 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

附言我在变量路径中得到值 C:\Data\Users\DefApps\AppData{F8267584-1051-4816-8195-EE018BA5155E}\local\Student.db3

谢谢

最佳答案

您缺少 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

关于sqlite - SQLite 实现中 xamarin.forms 中的 FileNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29228250/

相关文章:

ios - 使用 Swift + FMDB 打开和关闭数据库

ruby-on-rails - 在 Rails 3 中使用作用域

c# - MediaPlugin - 从路径获取媒体文件

c# - 如何根据反序列化 json 字符串的响应在两个类之间切换?

php - sql错误: General error: 25

java - SQLite数据库 ListView

java - 安卓 - SQLiteException : near "=": syntax error (code 1)

c# - 如何在 Xamarin.Forms 中获取嵌入文件的 URL/路径

c# - Xamarin Forms - 为 iPhone 和 iPad 编写单独的 UI

c# - 正在安装Braintree软件包,但出现错误消息“软件包Naxam.BrainTreeCore.iOS 4.8.2与netstandard2.1不兼容”