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