Just wondering what\'s the best approach to versioning of .NET builds?
I use:
I'm working on a project that has similar, but not identical requirements. Th major and minor versions are kept in AssemblyInfo as any standard .net project would have them. On our build server, we have a wrapper MsBuild script that invokes the .sln build, but it also does some setup tasks including generating additional build information. This build file is only executed on our build server. Developers building through Visual Studio will only build the .sln, and not get that additional behavior.
Good grief, all those complicated answers.
In TFS 2013 this is simple. The Community TFS Build Extensions site offers a simple PowerShell to pull the build number from the build name that is assigned by TFS.
You configure your build number format to be "$(BuildDefinitionName)_6.0.0$(Rev:.r)" which will result in something like "6.0.0.1" where the "1" is incremented for each build.
You then add the PowerShell versioning script to your build and it automagically scrapes the version number above and applies it to all AssemblyInfo.* files in the build folder. You can add additional file types by updating the script.