Wix 和自定义 .net dll
我正在寻找一些参考.NET dll的wix项目的完整示例(完整的wix VS项目、.net dll VS项目和编译的.net dll)。
我正在尝试运行 SampleAskKeyNet,但不断收到错误“此 Windows Installer 程序包存在问题。无法运行完成此安装所需的 DLL。请联系您的支持人员或程序包供应商,我正在尝试查找我做错了什么。
我在VS中创建了wix项目,在VS中创建了.net dll项目,编译了dll项目,将CheckPidPackage.dll复制到wix VS项目目录并编译了wix项目,然后我得到了这个错误。
I'm searching for some complete sample of wix project with reference to .NET dll (complete wix VS project, .net dll VS project, and compiled .net dll).
I'm trying to run SampleAskKeyNet and constantly I got error "There is a problem with this Windows Installer package. A DLL required for this installation to complete could not be run. Contact your support personnel or package vendor and I'm trying to find what I made wrong.
I created wix project in VS, .net dll project in VS, compiled dll project, copy over CheckPidPackage.dll to wix VS project directory and compile wix project. Then I run it and I get this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
接受的答案(由 user431821 提供)中提到的链接确实有帮助,但发布了对我有帮助的确切内容。
自定义操作项目创建 2 个 dll。如果项目是 CustomActionProject,它将创建 CustomActionProject.dll 和 CustomActionProject.CA.dll
我引用的是 CustomActionProject.dll,如下所示,它是常规 dll。
WIX 创建 CustomActionProject.CA.dll,它实际上不是 .NET 托管程序集,而是非托管程序集。所以我们必须引用它而不是常规的。
这解决了我的问题。
Link mentioned in accepted answer(by user431821) was indeed helpful but posting the exact thing which was helpful to me.
Custom actions project creates 2 dlls. If project is CustomActionProject, it will create CustomActionProject.dll and CustomActionProject.CA.dll
I was referencing to CustomActionProject.dll as below which is regular dll.
WIX creates CustomActionProject.CA.dll which is actually NOT the .NET managed assembly but unmanaged assembly. SO we have to refer to it instead of regular one.
This solved my issue.
也许这可能有用: http://www.codeproject.com/KB/install/wixcustomaction .aspx
Maybe this could be useful: http://www.codeproject.com/KB/install/wixcustomaction.aspx
对我来说,这是我的 CustomAction DllEntry 与我的方法名称不匹配。 IE
For me, it was my CustomAction DllEntry did not match my method name. i.e.
我忘记在 dll 上使用 MakeSfxCA.exe 来包装它。
更多详细信息请参见此处 通过 WiX 使用的 C# 中的自定义操作失败并出现错误 1154,此处 http: //blog.deploymentengineering.com/2008/05/deployment-tools-foundation-dtf-custom.html
I forgot to use MakeSfxCA.exe on dll in order to wrap it.
More details here Custom Action in C# used via WiX fails with error 1154 and here http://blog.deploymentengineering.com/2008/05/deployment-tools-foundation-dtf-custom.html