ASP.NET Assembly-Version

  • Thread starter Thread starter Morten Nielsen
  • Start date Start date
M

Morten Nielsen

How can I request the Assembly Version that I set in "AssemblyInfo.cs" ?

In a Windows application, I can get the current version using
Application.ProductVersion, but this naturally won't work with ASP.NET.
 
Hi Morten,

Take a look at the Assembly.GetName() method

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 
This is what I use (VB.NET)

lblVersion.Text =
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString


How can I request the Assembly Version that I set in "AssemblyInfo.cs" ?

In a Windows application, I can get the current version using
Application.ProductVersion, but this naturally won't work with ASP.NET.
 
Just a small note: be sure you're coding that line in a codebehind class, it
won't work if you code it inline into an .aspx as the executing assembly
will be the temporal one generated by asp.net,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 
Back
Top