Tuesday, January 12, 2016

ASP.NET MVC - Get Assembly Version and Information

The application/assembly version is normally found like below,

System.Reflection.Assembly.GetExecutingAssembly().GetName().Version

The above code will always return 0.0.0.0.

To find the assembly version of a ASP.NET MVC application, refer the below code,

typeof(MyNamespace.MvcApplication).Assembly.GetName().Version

MyNamespace refers to your ASP.NET MVC project namespace..

2 comments: