Wednesday, December 12, 2012

Automatically Increment Version number for Assembly

I have to look this up every time I do it, so I am posting this link to make it easier to find.


http://www.csharpcity.com/2012/visual-studio-automatic-version-numbering/



To summarize, you have to change the C# assemblyinfo.cs file from:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


to just:

[assembly: AssemblyVersion("1.0.*")]
 
 
The AssemblyFileVersion entry must not be present. 
 
The version only increments when the project is opened, so it may appear that the version does not increment.
 
 
For VB.NET it is similar.   Edit the assemblyInfo.vb file and change:
 
 
 
 
 
to:
 
  


The GUI for Assembly Version does not let you make this change.