Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild Property References

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!

like image 401
user1249013 Avatar asked Nov 13 '22 09:11

user1249013


1 Answers

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.

like image 146
krystan honour Avatar answered Nov 16 '22 02:11

krystan honour