web analytics

How to get the version information from AssemblyInfo.cs in ASP.NET Web application?

Options

codeling 1595 - 6639
@2015-12-23 11:07:23

In a Windows application, I can get the current version using:

Version version = new Version(System.Windows.Forms.
Application.ProductVersion);

But this naturally won't work with ASP.NET, so you have to use the following statement to get the version in ASP.NET

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

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com