There are situations when we require creating our own build numbers for each build that we publish. TFS allows us to do just that with the help of the TFSBuild.proj file.
For instance, we have project created and copiled into DLL that generates a number that we need to use in our TFS Project. This number generator is stored inside MyNumberGenerator.dll assembly. In order to use this number in our project we need to add UsingTask element to the TFSBuild.proj file right after import statement.
<UsingTask TaskName=”NumberGenerator.NumberGenerator” AssemblyFile=”MyNumberGenersator.dll”/>
In order to insert our task into BuildNumberOverrideTarget we need to add following XML at the end of the TFSBuild.proj file.
<Target Name = "BuildNumberOverrideTarget" >
< NumberGenerator >
<Output TaskParameter="BuildNumber" PropertyName="BuildNumber"/>
</ NumberGenerator >