【发布时间】:2013-06-13 15:11:32
【问题描述】:
使用 WIX,并尝试安装两个相同的程序集,一个用于 .Net35,另一个用于 .Net40。我正在使用两个单独的组件,但是 WIX 阻止了项目编译。
<Directory Id="GAC40" Name="GAC">
<Component Id="MyDllServicesModuleGac40Component" Guid="307675AA-8AEC-473B-A78A-FB362CCEDE2A" Win64="yes">
<File Id="MyDllNet40DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net40\MyDll.dll" />
</Component>
</Directory>
<Directory Id="GAC35" Name="GAC">
<Component Id="MyDllServicesModuleGac35Component" Guid="47E6BD1B-25CD-466D-945E-06DCF0F2A269" Win64="yes">
<File Id="MyDllNet35DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net35\MyDll.dll" />
</Component>
</Directory>
我收到的错误是:
错误29 ICE30: 'MyDllServicesModuleGac40Component.DDD7D974_FE9C_4BA3_BDD3_A1A3A23F8057' 和 'MyDllServicesModuleGac35Component.DDD7D974_FE9C_4BA3_BDD3_A1A3A23F8057':目标文件 'MYDLL.DLL' 由SFN系统上的两个不同的组件安装在 '[TARGETDIR] \ GAC \'。这会破坏组件引用计数。 D:\PROJECTS\MyDll.Experimental.3.0.0\Project\MyDll\MyDll.Wix.Services\MergeModule.wxs 34 1 MyDll.Wix.Services
安装程序应该能够检测到 .Net35 dll 安装到 GAC 的 C:\Windows\assembly,而 .Net40 dll 安装到 GAC 的 C:\Windows\Microsoft.NET\assembly。
重命名 DLL 不是一种选择。
谢谢!
更新
我在发布后自然想出了一个解决方案,似乎将组件包装在其他元素中让我可以让它工作。后来我阅读了 Tom Blodget 的帖子,所以这是正确的。
<Directory Id="GAC1" Name="GAC">
<Directory Id="GAC40" Name="GAC">
<Component Id="MyDllServicesModuleGac40Component" Guid="307675AA-8AEC-473B-A78A-FB362CCEDE2A" Win64="yes">
<File Id="MyDllNet40DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net40\MyDll.dll" />
</Component>
</Directory>
</Directory>
<Directory Id="GAC2">
<Directory Id="GAC35" Name="GAC">
<Component Id="MyDllServicesModuleGac35Component" Guid="FD74504A-6FE9-488E-9086-9DAD3024B35D" Win64="yes">
<File Id="MyDllNet35DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net35\MyDll.dll" />
</Component>
</Directory>
</Directory>
嗯,希望对某人有所帮助!
【问题讨论】:
标签: wix