Getting the assemply build number...

  • Thread starter Thread starter Stu
  • Start date Start date
S

Stu

Hi,

I want to write a page to track changes on a site.

How do I get the build number of the site's dll from a web page?

Thanks in advance.

Stu
 
You can do that with Reflection:

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

Assuming you're using the default autoincrement version number, you can
also calculate the build time from the version number, since the build
number is the number of days since 2000.01.01 and revision=1/2 number
of seconds since midnight. I include that in a collapsible div on each
page of the website I'm working on now, along with the assembly file
timestamp:

System.Reflection.AssemblyName assembly =
System.Reflection.Assembly.GetExecutingAssembly().GetName();
DateTime buildDate =
DateTime.Parse("01/01/2000").AddDays(assembly.Version.Build).AddSeconds(assembly.Version.Revision
* 2);

- Jon
http://weblogs.asp.net/jgalloway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Missing assemply reference 1
Strange compilation errors 3
killed sessions 1
Appropriate Building Blocks? 1
DLL versioning 1
Build Numbers in ASPX Pages 3
Remote Debugging 3
Web Site deployment in asp.net 2.0, 4

Back
Top