MVC – Display Version Number in Your UI

If you ever want to display the version of your app in the UI (useful in development with lots of environments) you can do the following.

In your Global.asax start method you can add:

Version version = Assembly.GetExecutingAssembly().GetName().Version;
Application["Version"] = string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);

This somewhere in your site UI you can do this:


Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.