How to determine the current version of ASP.NET MVC?

前端 未结 7 1985
北荒
北荒 2021-01-30 09:56

Is there a way to get the current version of ASP.NET MVC in code? Reflecting on MVC assemblies is needed? Any new IIS server variables? Some property to read in HTTP context?

7条回答
  •  执念已碎
    2021-01-30 10:26

    At runtime-

    string mvcVersion = typeof (Controller).Assembly.GetName().Version.ToString();
    

    At design time-

    • Go to your reference folder
    • look for system.web.mvc
    • Right Click on it
    • Click Properties Look at the Version property

    .

提交回复
热议问题