Skip to content

MSBuild - Date-based build number blues

Thu Jan 26 2006

According to this thread, Microsoft may run into visioning problems if they stick with their new build number scheme (major.minor.yMMdd.revision) next year. A Version in the .NET framework consists of 4 integers for the major, minor, build number, and revision in that format. When the build number uses the year as the first digit, it becomes 3.0.70101.0 for example on January 1st of next year. The build number only goes up to 65535. Oops. As an alternative, I think I'll be sticking with the BuildDay method, using the UpdateVersion tool. I was hoping to be able to use the AssemblyInfoTask to add a conditional task directly into my .csproj file, but maybe I can use some form of Exec task voodoo to get the UpdateVersion working with my build. I only want to update the version number when I compile in release mode, so hopefully I can write something with Condition=" '$(Configuration)' == 'release'" in the BeforeCompile target.

💾 May the source be with you. v3.2.419