WiX安装后程序无法加载DLL'SQLite.Interop.dll' [英] Program Unable to Load DLL 'SQLite.Interop.dll' after WiX Installation
问题描述
我使用WiX捆绑MSI安装文件。安装后,我执行该程序,但收到以下错误。
I use WiX to bundle a MSI installation file. After the installation, I execute the program but get the following 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)
我试图添加两个引用: SQLite.Interop
(x86和x64)进入WiX项目。但是我得到:
I have tried to add the two references: SQLite.Interop
(x86 and x64) into the WiX project. But I get:
由于以下原因,无法加载扩展名 ... \SQLite.Interop.dll:无法加载文件或程序集 file://.../x86/SQLite.Interop.dll或其依赖项之一。
The extension '...\SQLite.Interop.dll' could not be loaded because of the following reason: Could not load file or assembly 'file://.../x86/SQLite.Interop.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
此错误是由WiX还是由我自己的应用程序引起的?
Is this error caused by WiX or by my own application?
我尝试添加 SQLite.Interop.dll
(x64)对主项目的引用,但会出现此错误。
I tried to add the reference of SQLite.Interop.dll
(x64) to the main project but it gives this error.
无法添加对 V:\Users ... \bin\Debug\x64\SQLite.Interop.dll的引用。请确保该文件可访问,并且是有效的程序集或COM组件。
A reference to 'V:\Users...\bin\Debug\x64\SQLite.Interop.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
- System.Data.SQLite Downloads
- Unable to load DLL 'SQLite.Interop.dll'
推荐答案
在 Product.wxs
文件中,请添加以下内容:
In the Product.wxs
file, add these:
<Directory Id="INSTALLFOLDER" Name="MyApp">
<!-- ... -->
<Directory Id="x86_dir" Name="x86" />
<Directory Id="x64_dir" Name="x64" />
</Directory>
然后添加这些:
<Fragment>
<ComponentGroup Id="x86_files" Directory="x86">
<Component Id="SQLite_x86.Interop.dll" Guid="{GUID}">
<File Id="SQLite_x86.Interop.dll" Name="SQLite.Interop.dll" Source="$(var.MyApp_TargetDir)x86\SQLite.Interop.dll" />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="x64_files" Directory="x64">
<Component Id="SQLite_x64.Interop.dll" Guid="{GUID}">
<File Id="SQLite_x64.Interop.dll" Name="SQLite.Interop.dll" Source="$(var.MyApp_TargetDir)x64\SQLite.Interop.dll" />
</Component>
</ComponentGroup>
</Fragment>
这篇关于WiX安装后程序无法加载DLL'SQLite.Interop.dll'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!