How to Get Auto Incrementing Version Number in Visual Studio 2013 ?

If you are a user looking for a simple trick to auto incrementing version number in Visual Studio 2013 , here we go.

How to Get Auto Incrementing Version Number in Visual Studio 2013 ?

The AssemblyInfo class does the trick for you . Just include the asterik (*) to the end of the AssemblyVersion attribute in the AssemblyInfo class and you are done .

[assembly: AssemblyVersion("1.0.0.*")]

[assembly: AssemblyFileVersion("1.0.0.*")]

When you want to show the assembly version number , use the below code to display the version number .

using System;
namespace AbundantCode
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            // Test version
            var CurrentAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            string VersionNumber = CurrentAssembly.GetName().Version.ToString();
            Console.WriteLine(VersionNumber);
            Console.ReadLine();
        }

    }
}
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
Pin It

3 thoughts on “How to Get Auto Incrementing Version Number in Visual Studio 2013 ?

  1. Pingback: Auto Incrementing Visual Studio 2013 Version Number

  2. I have use this method and it worked up until VS 2010.

    I cannot get it to work for VS 2012, or 2013. Is there an additional configuration setting.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>