【发布时间】:2019-04-22 18:11:07
【问题描述】:
我计划将我的 WPF 应用程序发布到 Microsoft Store。 所以我按照LINK 来打包我的应用程序。
在访问 SQLite 数据库时,我使用的是 SQLite 开发团队开发的 System.Data.SQLite 库。
当我将我的应用程序作为 WPF 执行时一切正常,但是当我将我的应用程序作为 UWP 执行时它会引发错误:
System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
at System.Data.SQLite.SQLite3.StaticIsInitialized()
at System.Data.SQLite.SQLiteLog.Initialize(String className)
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at eComEasy.Lib.Helper.LibUtility.InitiateDbSchema(String connString, String[] names)
我该如何解决这个问题?
注意:我设法创建了db文件,但是当我想创建teble时,出现了上述错误。
【问题讨论】:
-
异常里面是否有一些额外的信息?喜欢内部异常?
-
不,或者我找不到它..
-
您是否记得将 dll 与应用程序一起部署?尽管有这个名字,
System.Data.SQLite不是 .NET 的一部分。 UWP 必须在其包中包含它需要的任何 dll -
@PanagiotisKanavos,我检查了 bin/AnyCPU/Debug/AppX/myapp 并且所有的 dll 都在那里
-
@MartinZikmund 我刚刚更新了错误消息