无法加载 dll sqlite interop dll WPF [英] unable to load dll sqlite interop dll WPF
问题描述
我正在做一个 WPF 应用程序并尝试部署/发布它.只要我在 Visual Studio 中运行应用程序,一切都很好.但是,当我尝试将部署文件 [从发布文件夹] 分离到另一个位置并尝试运行时,出现错误.
I am doing one WPF application and trying deploy/publish it. As long as i run the application within Visual Studio, everything is fine. But when i am trying separate the deploy files[From Release folder] to antoher location and trying to run, am getting error.
无法加载 DLL 'SQLite.Interop.dll':找不到指定的模块.(来自 HRESULT 的异常:0x8007007E)
Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
我从 Release 文件夹复制了 App.exe + App.exe.config + System.Data.SQLite.dll 文件.
I copied App.exe + App.exe.config + System.Data.SQLite.dll files from Release folder.
附加信息:
我已经安装了 SQLite Nuget 包.
I have installed SQLite Nuget package.
通过在解决方案属性中取消选中首选 32 位并将平台设置为任何 CPU 来尝试.
Tried by unchecking prefer 32-Bit and setting Platform to Any CPU in solution properties.
我是 WPF 的新手,如果我的部署过程或其他任何错误,有人可以纠正我吗?
I am new to the WPF, can anybody please correct me if my deploy process or anything else is wrong?
更新:
我还尝试将所有关联到 SQLite 的 DLL 与解决方案 exe 文件一起复制到新位置,但出现了同样的错误.
I also tried by copying all DLL's realted to SQLite to the new location along with solution exe file, but same error is popping up.
文件列表,我放在一起是:
List of file, i put together are:
App.exe
App.exe.config
System.Data.SQLite.dll
System.Data.SQLite.EF6.dll
System.Data.SQLite.Linq.dll
推荐答案
在解决方案资源管理器中,右键单击名称项目并选择<代码>添加 ->现有项目.然后将搜索更改为 All Files (*.*)
并打开 Sqlite.Interop.dll
.您可以在 bin\debug\x86 (or x64)
中找到它现在您的项目中有 dll(如果您右键单击它,您可以看到Build action = content").在Build Action = Embedded Resource"中更改它.
In Solution Explorer click with right button on the name project and choose
ADD -> Existing Item
. Then change your search to All Files (*.*)
and open the Sqlite.Interop.dll
. You can find it in bin\debug\x86 (or x64)
Now you have the dll in you project (if you right click on it, you can see "Build action = content"). Change it in "Build Action = Embedded Resource".
重新发布,仅此而已.
这篇关于无法加载 dll sqlite interop dll WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!