i am not very familiar with wix but i try to upgrade our bootstrapper for an msi package from wix3 to wix4. I used the HeatWave plugin for Visual Studio 2019 to upgrade. When i now try to build i`ve got a error for a duplicate id.
In our bootstrapper wie have a
bundle.xxs
<Chain>
<PackageGroupRef Id="NetFx48Redist"/>
[...]
</Chain>
and a
NetFx48.wxs (Link)
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<!--
.NET Framework installation state properties
Official documentation can be found at the following location:
.NET Framework 4.5/4.5.1/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1/4.7.2/4.8 - https://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
-->
<?define NetFx48MinRelease = 528040 ?>
<?define NetFx48WebLink = https://go.microsoft.com/fwlink/?LinkId=2085155 ?>
<?define NetFx48RedistLink = https://go.microsoft.com/fwlink/?linkid=2088631 ?>
<?define NetFx48EulaLink = https://referencesource.microsoft.com/license.html ?>
<?define NetFx48WebId = NetFx48Web ?>
<?define NetFx48RedistId = NetFx48Redist ?>
<Fragment>
<PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
<Property Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" Secure="yes" />
<SetProperty Id="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" Value="1" After="AppSearch" Condition="WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx48MinRelease)"" />
</Fragment>
<Fragment>
<util:RegistrySearchRef Id="NETFRAMEWORK45" />
<WixVariable Id="NetFx48RedistDetectCondition" Value="NETFRAMEWORK45 >= $(var.NetFx48MinRelease)" Overridable="yes" />
<WixVariable Id="NetFx48RedistInstallCondition" Value="" Overridable="yes" />
<WixVariable Id="NetFx48RedistPackageDirectory" Value="redist\" Overridable="yes" />
<PackageGroup Id="$(var.NetFx48RedistId)">
<ExePackage CacheId="$(var.NetFx48RedistId)_ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B" InstallArguments="/q /norestart /log "[NetFx48RedistLog].html"" PerMachine="yes" DetectCondition="!(wix.NetFx48RedistDetectCondition)" InstallCondition="!(wix.NetFx48RedistInstallCondition)" Id="$(var.NetFx48RedistId)" Vital="yes" Permanent="yes" Protocol="netfx4" LogPathVariable="NetFx48RedistLog" Cache="remove">
<ExePackagePayload Name="!(wix.NetFx48RedistPackageDirectory)ndp48-x86-x64-allos-enu.exe" DownloadUrl="$(var.NetFx48RedistLink)" ProductName="Microsoft .NET Framework 4.8" Description="Microsoft .NET Framework 4.8 Setup" CertificatePublicKey="F49F9B33E25E33CCA0BFB15A62B7C29FFAB3880B" CertificateThumbprint="ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B" Size="121307088" Version="4.8.4115.0" />
</ExePackage>
</PackageGroup>
</Fragment>
<Fragment>
<PackageGroup Id="$(var.NetFx48RedistId)AsPrereq">
<PackageGroupRef Id="$(var.NetFx48RedistId)" />
</PackageGroup>
<bal:ManagedBootstrapperApplicationPrereqInformation PackageId="$(var.NetFx48RedistId)" LicenseUrl="$(var.NetFx48EulaLink)" />
</Fragment>
</Wix>
In this case the build error
WIX0091 Duplicate symbol 'WixBundlePackageGroup:NetFx48Redist' referenced by ...\Bundle.wxs(21). This typically means that an Id is duplicated. Ensure all your identifiers of a given type (File, Component, Feature) are unique or use an access modifier to scope the identfier.
Is shown. As i understand the handling of using a fragment and push it via reference is correct. So the question is why i should change the ide
best regards
Daniel
You've duplicated a file from the WiX Toolset and are including it in your build as well as referencing the WixToolset.NetFx.wixext which includes that file. I'd recommend not duplicating the WiX Toolset code in your project.