What is the difference between property references such as $(TargetPath) and !(TargetPath) during the MSBuild PreBuildEvent/PostBuildEvent events? I find that they work differently in some situations but I cannot find any documentation on the "!(" form.
http://msdn.microsoft.com/en-us/library/bb383819.aspx This is the closest I seem to be able to find.
Example:
<Target Name="BeforeBuild">
<CreateProperty Value="NewValue">
<Output TaskParameter="Value" PropertyName="TargetPath" />
</CreateProperty>
</Target>
<PropertyGroup>
<PreBuildEvent>
echo $(TargetPath)
echo !(TargetPath)
</PreBuildEvent>
</PropertyGroup>
Will echo the original TargetPath and then echo "NewValue". This however does not work for other properties that I have defined.
Any help much appreciated!
Having just re-written our build process I can honestly say I have never used ! to reference anything, all I have ever used this character for is to say "NOT" as in a boolean operator.
In fact I cannot find this usage anywhere in the documentation or reproduce the behaviour you are describing.
I strongly suspect this is not valid/supported syntax for referencing anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With