3
votes

I know that the AssemblyInfo class can be set to auto increment the build number as such:

[assembly: AssemblyVersion("1.0.*")]

But this works only for building the app myself (i.e. from the IDE). I use TFS to build my solution (multiple projects). The assemblies in the build drop location are all still set to version 1.0.0.0. What is the path of least resistance for getting the build or revision number into the AssemblyVersion?
Ideally, TFS already has a $(BuildID), an auto-incrementing integer, that I use as my Build Number Format for defining my drop location...can't that just become the version build number in the AssemblyVersion and AssemblyFileVersion?

2
What does this have to do with Visual Studio?John Saunders

2 Answers

3
votes

Well, gave up on native TFS. This was the closest to a configuration-only solution (no coding). The documentation on this site shows clearly how to modify your TFS server and build to use this dll to get an incrementing number in your assembly's product and file build and rev (it's a Julian date and rev).

http://tfsversioning.codeplex.com/

2
votes

I think creating your own custom build activity to update the version number is the easiest way to achieve this. Here is a good post on that:

http://www.ewaldhofman.nl/post/2010/05/13/Customize-Team-Build-2010-e28093-Part-5-Increase-AssemblyVersion.aspx