Customizing Build Numbers in TFS with the help of TFSBuild.proj file

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 >


Some descriptionSome description 
Build Numbers

Featured pages

SharePoint Integration

Windows SharePoint Services is an integral part of Team Foundation Server. As a result, there is v…

Creating Team Project

Team Foundation Server allows creation of the portal project via TFS Portal Creation Wizard. This …

SQL Server Agent Jobs

Team Foundation Server installs several SQL Server Agent Jobs that allow it to perform certain tas…

tf Command

tf Command line utility provide many useful operations that we can perform with Team Foundation Se…

Shelving and Unshelving

Shelving is very powerful feature of the Source Control in VSTS that allows storing pending change…

MS Project Fields Mapping

TFS works with MS Project via mapping file with specific fields mapped from one application to ano…

Using MS Project with Team Foundation Server

MS Projects allows accessing Team Foundation Server and working with the TFS Work Items. This is a…

Managing Documents in TFS

Team Foundation Server provides us with the capability to manage various documents, also called ar…