Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can TFS 2012 set build numbers during a managed Build

Tags:

tfs

tfsbuild

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?

like image 446
Bob Avatar asked Jan 21 '26 16:01

Bob


1 Answers

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/

like image 130
Bob Avatar answered Jan 24 '26 10:01

Bob