Reputation: 22265
I'm using $(TargetPath)
for post-build event for my WiX installer, that is built under VS 2022, and it is translated to:
C:\projects\My project\Installer\installer.msi
when the .MSI file is created in:
C:\projects\My project\Installer\en-us\installer.msi
What is wrong there?
Upvotes: 0
Views: 479
Reputation: 564
The PostBuildEvent property is evaluated before any targets are executed. In your case the initial value of $(TargetPath) is expanded before the wix target is called and changes it's value. Moving your post build commands to an AfterBuild target in your csproj file will solve this issue.
<Target Name="AfterBuild">
<Exec Command="echo $(TargetPath)" />
</Target>
Upvotes: 0