Can it be considered in MSBuild?

All I do is try to keep track of the number of times a specific target has been called. Can this be done with msbuild?

EDIT:

I tried to do something like this:

<Message Text ="The sum of $(NumberOne) and $(NumberTwo) is $([MsBuild]::Add($(NumberOne),$(NumberTwo))"/> 

but that didn't work either. My result was Sum 2 and 3 equals $ ([MsBuild] :: Add ($ (NumberOne), $ (NumberTwo))

Regarding the suggestion to use the element: I think I could use additional information. I have read some articles, but I don’t see how they can be used as integers. They seem to be intended for file collections.

+4
source share
2 answers

And your example works fine, you are simply mistaken in the class name: it should be [MSBuild] , not [MsBuild]

 <Message Text ="The sum of $(NumberOne) and $(NumberTwo) is $([MSBuild]::Add($(NumberOne), $(NumberTwo)))"> 
+3
source

Yes there is. Create an element, and then use Math.Add to enlarge it:

 <Math.Add Numbers="$(ITEM);1"> <Output TaskParameter="Result" PropertyName="ITEM"/> </Math.Add> 
+1
source

Source: https://habr.com/ru/post/1433031/


All Articles