3

Is it possible for a .NET assembly to know when it was built?

Jader Dias
  • 88,211
  • 155
  • 421
  • 625
  • 2
    http://stackoverflow.com/questions/324245/asp-net-show-application-build-date-info-at-the-bottom-of-the-screen – naveen Feb 14 '11 at 15:50

3 Answers3

7

Here is an interesting article, which explains three ways to find the build date of an assembly :

Determining Build Date the hard way

Dalmas
  • 26,409
  • 9
  • 67
  • 80
2

Assembly metadata does not contain a build date. You could do a couple of things though:

  1. Use the filesystem's modified date to check when it was built.
  2. Encode the date into the assembly version.
Andrew Hare
  • 344,730
  • 71
  • 640
  • 635
1

If you use http://autobuildversion.codeplex.com/

It has an option to add a number of date combinations to any of the Assembly(File) Version. And it will update this on every build.

I usually have something like year + day of year as my revision numbers.

Like 1 Jan 2011 would be : 11001

gideon
  • 19,329
  • 11
  • 72
  • 113