I would like to have a Constant or field defined in my application startup code that reflect the date that the application was actually built. Something like for example:
Private Shared ApplicationBuiltOn As Date = <and here is where I would like to set the build date>`
Can this be done using build events so that it is always set and I don't actively have to remember to do it prior to actively building a release version.
If it is possible how does one do it? I've read through the msdn documentation on build events but nothing seems to cover what I'd like to try and do.
You could try this (tested it and worked for me)
And use it like this:
NOTE: Grabbed together from https://stackoverflow.com/a/3634544/4237809 and http://blog.codinghorror.com/determining-build-date-the-hard-way/