views:

135

answers:

4

Hello there,

I will start from example: I have an version of my app which looks like this 1.0.3450.26573 (it is hard to read and looks nasty). Code to take this version is:

String Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

I want to see version 1.0.12, 1.0.13, 1.0.14 where 1.0.[BUILD], where BUILD is auto increasing on each build.

How can I do this in a best way?

+1  A: 

Actually, build number will not do you any good unless you'll be able to track which build number corresponds to which version of source code your application was built from. Rather, consider using revision number from your repository (if your SCM tool is anything similar to Subversion; to do so try svnversion).

Anton Gogolev
A: 

You have to integrate that with your build environment. For us, CruiseControl.net increments the version number on each build. But you could also use a SVN revision number etc. There are several possibilities.

If you only want 3 digits instead of 4, you have to format the string yourself.

chris166
A: 

Yeah, revision number would be great, but how I can get it, I use SourceGear Vault.

Lukas Šalkauskas
Vault Plug-in for CruiseControl.NEThttp://download-us.sourcegear.com/Vault/4.1.4.18402/CCNetPlugin.zip
abmv
+1  A: 

Versioning Controlled Build

abmv