How to display ASP.net MVC project version on page?

In WinForms, I would use Application.ProductVersion .

I tried using System.Reflection.Assembly various ways, but I can never get the version of the MVC project only.

+4
source share
1 answer

If this code is explicitly specified in the MVC project (and not in the auxiliary assembly), you should be able to use System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3) , which returns the major, minor, and revision numbers . Otherwise, you can use something like typeof(HomeController).Assembly.GetName().Version.ToString(3) .

+6
source

All Articles