I'm going through the painful task of upgrading a WIX 3 installer project to WIX 4 and have hit a stumbling block with the harvesting of an ASP.NET MVC project.

Several of the files that are being harvested are in folders that have a hyphen in their name (e.g. chart-js).

When I harvest using and build I get the following error:

The Directory/@Id attribute's value, 'ProjectName.Content.Scripts.chart-js', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore.

Full Project file code is:

    <Project Sdk="WixToolset.Sdk/4.0.3">
        <PropertyGroup>
            <SkipValidatePackageReferences>true</SkipValidatePackageReferences>
            <EnableProjectHarvesting>true</EnableProjectHarvesting>
            <HarvestProjectsSuppressUniqueIds>true</HarvestProjectsSuppressUniqueIds>
        </PropertyGroup>
        <ItemGroup>
        <HarvestProject Include="..\PTS\PTS.vbproj" ProjectOutputGroups="Binaries;Content;"/>
      </ItemGroup>
      <ItemGroup>
        <PackageReference Include="Microsoft.Bcl.Build" Version="1.0.21" />
        <PackageReference Include="WixToolset.Heat" Version="4.0.3" />
        <PackageReference Include="WixToolset.Iis.wixext" Version="4.0.3" />
        <PackageReference Include="WixToolset.Netfx.wixext" Version="4.0.3" />
        <PackageReference Include="WixToolset.Sql.wixext" Version="4.0.3" />
        <PackageReference Include="WixToolset.UI.wixext" Version="4.0.3" />
        <PackageReference Include="WixToolset.Util.wixext" Version="4.0.3" />
      </ItemGroup>
      <ItemGroup>
        <ProjectReference Include="..\PTS\PTS.vbproj" />
      </ItemGroup>
    </Project>

My question is, how do I control the naming of the ID's of the folders (Id's of components in the generated wxs file look to automatically have - replaced with _, but Directories don't)?

0

There are 0 best solutions below