Hi Cam,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the build date of an
assembly programatically. If there is any misunderstanding, please feel
free to let me know.
On approach that I know, is to get it from the version number that VS.NET
has generated automatically. If we use <Assembly: AssemblyVersion("1.0.*")>
as assembly version, VS.NET will generate build number and revision
according to the current date and time. We can try to use the following
code to get the build date.
Private Function BuildDate() As DateTime
'Build dates start from 01/01/2000
Dim result As Date = #1/1/2000#
'Retrieve the version information from the assembly from which this
code is being executed
Dim version As System.Version =
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version
'Add the number of days (build)
result = result.AddDays(version.Build)
'Add the number of seconds since midnight (revision) multiplied by 2
result = result.AddSeconds(version.Revision * 2)
'If we're currently in daylight saving time add an extra hour
If TimeZone.IsDaylightSavingTime(Now,
TimeZone.CurrentTimeZone.GetDaylightChanges(Now.Year)) Then
result.AddHours(1)
Return result
End Function
For more information, please check the following link:
http://dotnetfreak.co.uk/blog/archive/2004/07/08/146.aspx
PS: There is a little mistake in the code provided in the link. I have
fixed it in my code.
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."