Mathias Olausson [MVP] :: thoughts on Visual Studio ALM

How to show the source version used in a TFS 2010 build

With Team Foundation Build 2010 it is easy to specify which version of files to get for the build. Unfortunately the build report will only show the default values, which is confusing if you want to use that information as a reference when managing your builds. But fortunately the new build process is very customizable so changing this behavior is quite straight-forward.

First go to the build definition and copy the build template:

image

image

Next download new build template, check it out and open it in the workflow designer. What we need to do to change the default behavior is to add a SetBuildProperties activity after the GetWorkspace step:

image

In this case we want to set the SourceGetVersion property to GetVersion:

image

Check in the build definition and start a new build, passing the desired version (any versionspec, label RC2 in this example):

image

The resulting build result will now show the correct information in the report.

image