0

It seems that, when using the following syntax in a C# project's AssemblyInfo.cs file, the Revision value doesn't observe Daylight Saving Time (it does use local time).

[assembly: AssemblyVersion("1.0.*")]

Is there a way that I can make .NET consider DST when converting the above into the timestamp?

starblue
  • 55,348
  • 14
  • 97
  • 151
lance
  • 16,092
  • 19
  • 77
  • 136
  • If it doesn't already, I don't believe you could make it. The attribute and how it generates the version, is internal BCL code that can't be controlled outside of Microsoft. – Oded Oct 14 '11 at 18:52
  • I've been trying to find where *anything's* documented about the numbers that are automatically chosen using that format. The only related documentation I've found suggests that the numbers are arbitrary - that they're not *meant* to necessarily be a date and time. Do you have any docs specifying that they *should* be? – Jon Skeet Oct 14 '11 at 18:53
  • 1
    @Jon - The description in the attribute constructor documentation does: http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.assemblyversionattribute.aspx – Oded Oct 14 '11 at 18:59
  • Or maybe, if you need granular control over the assembly versioning scheme, you can use AssemblyFileVersion instead. You can refer to this article: http://www.all-things-sharp.com/2011/08/custom-assembly-versioning-with-vs-2010.html – Anas Karkoukli Oct 14 '11 at 19:00
  • @Oded: Ah, thanks. I wonder why that wasn't mentioned elsewhere. – Jon Skeet Oct 14 '11 at 19:02
  • Related link http://stackoverflow.com/questions/1600962/displaying-the-build-date – xanatos Oct 14 '11 at 19:11
  • The 'assembly' tag is for low level programming, not for .NET assemblies. – harold Oct 14 '11 at 19:28

2 Answers2

1

Well, wrong question, you should have asked how to get it to use UTC. Because if you don't know where the build server is located then the timestamp you get doesn't mean anything anyway. If you do know where it is located then you know enough to reverse engineer the DST time too with the TimeZoneInfo class.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
1

You cannot make .NET consider DST when converting the asterisks into the timestamp.

lance
  • 16,092
  • 19
  • 77
  • 136