When I compile my WIX project I'm getting the following errors:
error LGHT0091: Duplicate symbol 'File:X.dll' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique.
error LGHT0092: Location of symbol related to previous error.
My components are defined like this and the two errors are occuring on each of the <file>
elements.
<!-- ... -->
<Component Id="AXdll" Guid="{12CFD2B0-CB29-458C-BCEF-35C9AFA88363}" Directory="A">
<File KeyPath="yes" Source="!(bindpath.A)\X.dll" />
</Component>
<!-- ... -->
<Component Id="BXdll" Guid="{3DE33C12-72FD-412A-8685-BE4A6FB5A538}" Directory="B">
<File KeyPath="yes" Source="!(bindpath.B)\X.dll" />
</Component>
<!-- ... -->
The two X.dll files are different files that are in separate directories.
As specified the <file>
tag does not have an ID
attribute. When WIX comes accross this it creates a default ID. It does this by taking just the file name of the Source
attribute. As such it doesn't matter that the two files are in different directories they still have the same ID "X.dll".
To correct this it is necessary to give the ID attributes explicitly something like this:
<!-- ... -->
<Component Id="AXdll" Guid="{12CFD2B0-CB29-458C-BCEF-35C9AFA88363}" Directory="A">
<File ID="A_X.dll" KeyPath="yes" Source="!(bindpath.A)\X.dll" />
</Component>
<!-- ... -->
<Component Id="BXdll" Guid="{3DE33C12-72FD-412A-8685-BE4A6FB5A538}" Directory="B">
<File ID="B_X.dll" KeyPath="yes" Source="!(bindpath.B)\X.dll" />
</Component>
<!-- ... -->