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.

  • exit code from windows console app not available in git hook script
  • Remove some commits in GIT
  • For a .Net project, what file extensions should I exclude from source control?
  • C# Git Command issue
  • Development on existing Umbraco-project
  • Can I add custom version strings to a .net DLL?
  • 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:

    1. How do I create the above described version number.
    2. How do I name the TFSerivce build name including the version number?
    3. How do I make GIT aware of the version number and display them “somehow”?

  • Abort a commit in Git if user.name and user.email are not configured
  • Git command to get a non-committed remote changes
  • Sourced git alias fails
  • Self-host remote git repository on Windows server
  • What files should be included in .gitIgnore in MonoTouch projects/solutions?
  • Best way to migrate mercurial repo with subrepositories to git, preserving history?
  • 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.
    Git Baby is a git and github fan, let's start git clone.