开发者

How to display an ASP.net MVC project version in page?

In WinForms, I'd use Application.ProductVersion.

I've tried using System.Reflection.Assembly 开发者_Python百科in various ways but can never get the version of just the MVC project.


Provided this code is explicitly in the MVC project (rather than in a helper 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 might want to use something like typeof(HomeController).Assembly.GetName().Version.ToString(3).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜