WiX ICE30 error but directory is correct

2020-04-13 18:34发布

问题:

My WiX (3.10.3.3007) project has 2 different web.config files from, and installed to, 2 different locations. The 2 errors from my build are: Error ICE30: The target file 'svcenub9.con|Web.config' is installed in '[TARGETDIR]\inetpub\wwwroot\barcode\' by two different components on an LFN system: 'web_config' and 'views_web_config'. This breaks component reference counting.

Error ICE30: The target file 'svcenub9.con|Web.config' is installed in '[TARGETDIR]\inetpub\wwwroot\barcode\' by two different components on an LFN system: 'web_config' and 'views_web_config'. This breaks component reference counting.

The XML in question, and their directories, are:

<Fragment>
   <DirectoryRef Id="barcode">
      ...
      <Component Id="web_config" Guid="*">
         <File Id="web_config" KeyPath="yes" Source="$(var.buildSrc)\BarcodeIntegrationService\Web.config" />
      </Component>
      ...
      <Directory Id="views">
         ...
         <Component Id="views_web_config" Guid="*">
            <File Id="views_web_config" KeyPath="yes" Source="$(var.buildSrc)\BarcodeIntegrationService\Views\Web.config" />
         </Component>
      ...
      </Directory>
   ...
   </DirectoryRef>
</Fragment>

Since this is an ICE error I do have an MSI generated. When I look there at the Component table I can see that they do indeed have distinct directories.

Is there something in my WiX project that I'm not adding?

回答1:

The problem is that my Directory elements did not have a Name attribute. In the Directory table the DefaultDir was set to . for all of my directories. Thus the ICE was viewing them as the same directory.