3

I am currently configuring my .NET 4.5 solution in the TFS Build 2010. I am working with Visual Studio.

I have a versioninfo.cs file as part of my solution. How can I set this up to increment the version number in it during the build process? What change do I need to make to my build definition for this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
amateur
  • 43,371
  • 65
  • 192
  • 320

2 Answers2

3

What is versioninfo.cs in your implementation?

The way I typically do automatic versioning is to use the Community TFS Build Extensions TfsVersion activity: http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20TfsVersion%20build%20activity&referringTitle=Documentation

I usually use the format: Major.Minor.YYMM.DDRR where Major/Minor are passed as arguments via the Build definition and manually incremented. YY/MM/DD/RR are the year-month-day-revision that allows me to know which specific build/source was used to create an assembly given it's version #.

If you have multiple branches/builds that you want to distinguish between based on the assembly version alone you may need to tweak your version numbering scheme slightly to include some kind of branch identifier.

Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
2

Try this answer to Stack Overflow question Working automatic build increment Visual Studio addin.

This is a free independent stand-alone tool named ProjectBuildCounter which I hope is what you're looking for.

Community
  • 1
  • 1
i100
  • 4,529
  • 1
  • 22
  • 20