将程序集安装到GAC时出现问题

时间:2011-09-26 13:03:45

标签: wix

我正在尝试使用WiX在GAC中部署几个第三方程序集。这些组件中的一些是混合组件。这样做的常见方法似乎是将相应文件的assembly-attribute设置为“net”。但是,这样做会在安装过程中产生错误:

Error 1938. An error occurred during the installation of assembly ...One or more modules of the  assembly could not be found. HRESULT: 0x80131042. assembly interface: IAssemblyCacheItem, function : Commit, component: ...   MSI (s) (A8:B0) [12:32:39:085]:....    assembly .... One or more modules of the assembly could not be found. HRESULT: 0x80131042. assembly interface: IAssemblyCacheItem, function: Commit, component:...

我从供应商处获得的用于将组件安装到gac的说明是:

  1. 将所有dll(d1,d2,d3,...,dn)放在同一目录中。
  2. 在这些dll的子集上运行gacutil。
  3. 如果我在gac中看到“原始”外观,其中一个文件夹内容如下所示:

    gac_32 \ D1 \ 0.0.0.0_271E3736135E91A2 \ d1.dll gac_32 \ D1 \ 0.0.0.0_271E3736135E91A2 \ d2.dll gac_32 \ D1 \ 0.0.0.0_271E3736135E91A2 \ d3.dll

    gacutil发现d2.dll和d3.dll需要放在与d1.dll相同的目录中并自动完成。

    如何使用wix执行此操作?我现在看到的唯一方法是将gacutil称为自定义操作,但这似乎不是一个好的解决方案。

    谢谢 斯蒂芬

1 个答案:

答案 0 :(得分:4)

如果其他人正在努力解决这个问题:

要安装由一个托管程序集和一个或多个托管程序集引用的本机或混合dll组成的多文件程序集,请在WixSetup中创建以下结构:

<Component Id="MyMultifileAssembly" Guid="abc">
        <File Id="ManagedAssembly" KeyPath="yes" Source="$(var.ThirdParty)\Managed.dll" Assembly=".net"/>
        <File Id="UnmanagedAssembly1" KeyPath="no" Source="$(var.ThirdParty)\Unmanaged1.dll" />
        <File Id="UnmanagedAssembly2" KeyPath="no" Source="$(var.ThirdParty)\Unmanaged2.dll" />
</Component>

两个非托管程序集都将转到安装托管dll的GAC文件夹。

相关问题