Search code examples
c#.netasp.net-mvc-3revision

Where does MVC3 save the revision number?


The actual version number of my solution is placed in Properties/AssemblyInfo.cs:

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

The last part of that number is an askerisk. It will be replaced by an revision number. By the following code in my controller, I am able to get that full version number, including the revision number:

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

Where does MVC3 save the revision number?


Solution

  • When using the * in the revision number, then the 3rd digit will increment each day, and the 4th will be generated based on time-of-day.

    What you're seeing is the 4th digit generated based on time-of-day. You'll notice that after midnight it will reset close to 0.

    If you use a version such as "1.0.*", then the 3rd and 4th digits will generate automatically.