Search code examples
msbuildwixheatwix3.9

Wix/Heat: Access <ProjectReference> inside .wixproj file


I am running a heat command as pre-build event in my installer.wixproj. I want my dir-parameter (HarvestPath) to be the target directory of my included project reference.

Now inside my .wixproj-file I have

<PropertyGroup>
  <HarvestPath Condition=" '$(HarvestPath)' == '' ">"@(ProjectReference.TargetDir)"</HarvestPath>
  <DefineConstants>HarvestPath=$(HarvestPath)</DefineConstants>
</PropertyGroup>

<ProjectReference Include="..\..\NAME.csproj">
  <Name>NAME</Name>
  <Project>SOME_GUID</Project>
  <Private>True</Private>
  <DoNotHarvest>True</DoNotHarvest>
  <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
  <RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>

How can I access the target directory of the project reference? "@(ProjectReference)"only gives me the full path to its .csproj file and I can't find any documentation for that.


Solution

  • Ok so I found a workaround in case anyone is interested. I simply used "$(SolutionDir)\MY_PROJECT_FOLDER\MY_PROJECT_TARGET". It's not exactly what I aimed for but it works.