gpt4 book ai didi

c# - WP8 SQLite 错误 : The specified module could not be found

转载 作者:IT王子 更新时间:2023-10-29 06:20:58 24 4
gpt4 key购买 nike

我正在尝试从我的 Windows Phone 8 应用程序访问 SQLite 数据库,但每当命中 SQLite 代码时都会遇到以下错误:

{System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Sqlite.Sqlite3.sqlite3_open_v2(String filename, Database& db, Int32 flags, String zVfs)
at SQLite.SQLite3.Open(String filename, Database& db, Int32 flags, IntPtr zVfs)
at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks)
at TopoMap.Map.MapTileServer.<Initialise>d__0.MoveNext()}
  • 我已经安装了 Visual Studio 扩展 Windows Phone 的 SQLite (v3.8.4.3)。
  • 我已经安装了 sqlite-net-wp8 NuGet 包 (v3.8.4.3)。
  • 我已将 SQLite.csSQLiteAsync.cs 添加到我的项目中。
  • 我已将 USE_WP8_NATIVE_SQLITE 条件编译符号添加到我的项目中。

项目运行良好,没有任何问题,直到一行代码访问底层的 Sqlite3 类。

知道问题出在哪里吗?

最佳答案

  1. 从解决方案中删除对 sqlite 的所有引用
  2. http://visualstudiogallery.msdn.microsoft.com/cd120b42-30f4-446e-8287-45387a4f40b7 为 WP8 安装 Sqlite
  3. 重新启动 Visual Studio。就我而言,它是 Visual Studio 2013。
  4. 打开您要使用 sqlite 的解决方案
  5. 使用包管理器控制台安装 sqlite-net。输入以下命令:Install-package sqlite-net
  6. 安装 sqlite-net-wp8。输入以下命令:Install-package sqlite-net-wp8
  7. 添加编译配置

    7.1 右键单击​​项目并选择属性。

    7.2 选择构建选项卡。

    7.3 在Configuration列表中,选择All Configurations。

    7.4 在平台列表中,选择所有平台。

    7.5 在 Build 选项卡上,您会在 General 标题下看到条件编译符号,其中包含默认值 SILVERLIGHT;WINDOWS_PHONE 在 Windows Phone 应用程序项目上。将值更改为 SILVERLIGHT;WINDOWS_PHONE;USE_WP8_NATIVE_SQLITE 并保存项目文件。

  8. 右键单击引用并选择添加引用。转到 Windows Phone -> 扩展并选中 SQlite for Windows Phone 选项

对我有用!!祝你好运

关于c# - WP8 SQLite 错误 : The specified module could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23195044/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com