I'm starting to use WiX in order to do automated builds to create msi's of my c# projects and am experiencing the error "Undefined preprocessor variable '$(var.MyProject.TargetDir)'"
I am using the latest WiX v3.0.5419. Inside my wxs file I am trying to use pre-processor variables that are listed on this webpage (http://blogs.msdn.com/jrock/archive/2008/01/29/complete-list-of-candle-preprocessor-variables.aspx)
<Component Id="MyId" Guid="MyGuid">
<File Id="MyId" Name="MyName" KeyPath="yes"
Source="$(var.MyProject.TargetDir)\MyName.dll" />
</Component>
I have added the reference for MyProject to the .wixproj and if I open it up in Notepad I can see the reference.
<ItemGroup>
<ProjectReference Include="..\MyProject.csproj">
<Name>MyProject</Name>
<Project>{guid}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
This is my nant build script that I use to create the msi. Maybe it's because the .wixproj knows about the project reference which isn't used in the build?
<exec basedir="${tools.wix}" managed="true" program="candle.exe">
<arg line='-out "${tools.wix.objfile}"' />
<arg value="../MySetup.wxs" />
</exec>
Can anyone enlighten me on this please?