【问题标题】:WiX adding .net files to GACWiX 将 .net 文件添加到 GAC
【发布时间】:2013-04-11 06:32:47
【问题描述】:

我在使用msi installer file. 将程序集文件复制到GAC 时遇到问题我的项目要求我将一些.netmodule 文件以及.dll 文件添加到GAC。但是在<File> 元素中使用assembly = ".net" for .netmodule 文件会引发错误(构建错误)。

Error   2   The assembly file 
'C:\Users\p486\Desktop\DCUBEII\GAC\Cdcube_inq_dynftrm_lnk_srv.netmodule' appears to be
invalid.  <br/>Please ensure this is a valid assembly file and that the user has the 
appropriate access rights to this file. <br/> More information: HRESULT:<br/> 
0x80131018  C:\Wix\MainProject\MainProject\GACFiles.wxs 16  1   MainProject

如何将这些 .netmodule 文件复制到 GAC?

如果我们手动将 .dll 文件拖放到 C:\Windows\assembly 文件夹中,所有 .netmodule 文件都会自动复制,但如果尝试使用安装程序仅将 .dll 文件复制到 GAC 中,则会引发安装时间错误。如何将这些文件复制到 GAC?

【问题讨论】:

    标签: wix gac wix3.6


    【解决方案1】:

    我没有太多使用.netmodule 文件,但我的理解是.netmodule 需要与assembly 位于相同的Component 中。例如:

    <Component>
       <File Assembly='.net' Source='path\to\assembly.dll' />
       <File Source='path\to\first.netmodule' />
       <File Source='path\to\second.netmodule' />
       ...
    </Component>
    

    Component 将 GAC 程序集并携带所有 .netmodule 文件。

    【讨论】:

    • 我至少有 100 个 .netmodule 文件。我们可以使用 heat.exe 在单个组件中收集所有这些 元素吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多