Wednesday, January 03, 2007

File Version Numbering Information to Amaze your Friends and Family With (or how to win at Geek-Trivia)

MSBuild Team Blog - Why are build numbers limited to 65535?

"...it's imposed by the operating system:

Binary version number for the file. The version consists of two 32-bit integers, defined by four 16-bit integers. For example, "FILEVERSION 3,10,0,61" is translated into two doublewords: 0x0003000a and 0x0000003d, in that order. Therefore, if version is defined by the DWORD values dw1 and dw2, they need to appear in the FILEVERSION statement as follows: HIWORD(dw1), LOWORD(dw1), HIWORD(dw2), LOWORD(dw2).

..."

MSBuild Team Blog - Fixing invalid version number problems with the AssemblyInfoTask

"The arrival of 2007 bought a flurry of e-mails to the MSBuild team from people having trouble with the AssemblyInfoTask. The symptom is simple to describe - the builds start to fail with the following error:

Error emitting 'System.Reflection.AssemblyVersionAttribute' attribute -- 'The version specified '1.0.70102.1' is invalid


The fix to get builds going again is to change the date format used to generate the build number to something other than the default "yyMMdd". The date formats are in Microsoft.VersionNumber.target, located in %program files%\MSBuild\Microsoft\AssemblyInfoTask, and there are two of them (one for file version and one for assembly version). You can use any format you want. Within Visual Studio we're now using 01MMdd. ..."

I was thinking of moving to a date based version number scheme too. I may have to rethink that... :|

2 comments:

Anonymous said...

You can use a date based version number, provided you use Julian dates. Not as easy to read, but simple.

Greg said...

Good point. Thanks