10

TFS Build 2010 uses an internal build number. It's similar to $(Rev:.r). $(Rev:.r) increases in each day while internal build number are increased in other way.

The questions are:

  1. What is the official name of the internal build number?
  2. How to access internal build number in macro format in order to use it in "Build Number Format" within the build definition?
  3. The internal number is only shown when a build fails and is only accessible via BuildDetail variable in team build process templates. It is not shown and could not be searched in Build Explorer. How can I get it shown and search-able in Build Explorer?
  4. How this internal build number increases? With each build among all definitions? In a total project collection?
jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
  • 1. 'Internal Build Number' is actually defined as IBuildDetail.BuildNumber, and this number is unique over all builds (thus, not the same as '$(Rev:.r)' which is unique within the 'BuildDefinitionName' within which it's used. – Shaun Wilson Jun 20 '11 at 21:20
  • 4
    4. This is unique within the 'BuildDefinitionName' format string, that is, if you coded the build definition name as "test_$(Rev:.r)" and queued 3 builds a day you would have "test_9" on day 3. Whereas if you define the format as "test_$(DayOfMonth)_$(Rev:.r)" then you would never see a rev of '9', you would see revs 1-3 for each day you built. – Shaun Wilson Jun 20 '11 at 21:32

1 Answers1

11

Try $(BuildID) from MSDN's "Work with Build Numbers".

Ryan Gates
  • 4,501
  • 6
  • 50
  • 90
drewBai
  • 111
  • 1
  • 3