avatar

professional geek ramblings
est. 2003
About

MSBuild: Date-based build number blues

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.