Version Number in Assembly, GIT and TFService
Until now we used version numbers like 2.4.1 for our VB.NET products. We set them manualy.
Now we start to use GIT with Team Foundation Service and want to improve the version number handling. The aim is simple: The format should be Major.Minor.Build.Revision. With Revision automatically inscreasing for each compile. The Build should increase for each Team Foundation Server compile (after a git push we let TFS create a continuous build). Major and Minor should only increase manually.
The version number should be visible in three places: (1.) As assembly version in the application. (2.) In the GIT to find a version. (3.) The Team Foundation Service build name.
So my questions are:
- How do I create the above described version number.
- How do I name the TFSerivce build name including the version number?
- How do I make GIT aware of the version number and display them “somehow”?
One Solution collect form web for “Version Number in Assembly, GIT and TFService”
I don’t know if this question is still relevant. If it is, I can give a solution. The only thing I can’t answer is how to link an automatic generated build number following your specifications to a build name. For what I know, you need to choose between manually specifying your build number or auto generating it. Or you have to create a fully custom build template.
Using the default template:
- Specify your build number using the info on: http://msdn.microsoft.com/en-us/library/vstudio/hh190719.aspx
- Put a “nextversion” file in the source control
- Specify a “*” in the assemblyversion for the local revision autonumbering
- Throw in a prebuild powershell script similar to http://www.colinsalmcorner.com/2013/07/matching-binary-version-to-build-number.html (using the “nextversion” file instead of the -manually entered- build number)
- In a post-build, create and push a tag with your version number onto the git repository, preferably using a powershell script (didn’t find an example – you best install the git tools on the build server for this). Also commit and push the modified assembly info files.