SRL Group

This blog is about Team System, QA and Development methodologies and more...

VSTS Resources

Team System Bloggers

Version number NOT latest when running a build with custom build number running on TFS 2008

Hi there,

I ran into a confusing matter today at work.

We have a build that ran on TFS Build 2005 that did the following:

  • Execute a custom task in BuildNumberOverrideTarget that:
    • checked out a file
    • change the file version that it holds tor the project (++)
    • checked in the file
  • Override the BuildNumber parameter
  • Get Source
  • Compile.

After upgrading to TFS Build 2008 we noticed something very confusing, when we checked the dll versions it was always one version older than expected. (If we had a folder named 1.0.43.0 the dll inside were version 1.0.42.0 for example)

It was a little hard to understand the problem but the solution was very easy.

The problem lays with the fact that the architecture of the build in TFS was changed somewhat in 2008, instead of getting the latest version by default in the Get Source stage the new default is to get the last changeset when the build was started, this change was made to make sure that if someone else checked in something in that exact same moment it will not be compiled accidently. Of course the problem is now that the changed version number will not be in the version that will be downloaded and compiled.

The solution is simple, you just have to override the GetVersion parameter like this

   1: <GetVersion>T</GetVersion>

The meaning of T is that the Get command will get the latest version.

 

Simple, isn’t it?

Yigael Oscar

Comments

Team System News said:

The SRL Team Blog on Version number NOT latest when running a build with custom build number running

# February 2, 2009 4:28 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: