Automatic Versioning

Submitted by:Pitter Alderson

Date added:15 March, 2015

Category:C#

How to automize versioning by modifying a line in the AssemblyInfo file.

Tags: automize , versioning

Code Snippet:

// Modify the AssemblyVersion line in the 
// "AssemblyInfo.cs" file:

// Add a "*" to the section you want to increase automatically
[assembly: AssemblyVersion("0.9.0.*")]

// Remove this if you add the star
//[assembly: AssemblyFileVersion("1.0.0.0")]

// In your windows application you can access the current version
// like this:
MessageBox.Show(this.ProductVersion);
// "this" contains the the current "Form" object.

 
 

Comments