Thursday, January 26, 2006 3:32 PM Christopher

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.

Filed under:

Comments

# re: MSBuild: Date-based build number blues

Sunday, January 29, 2006 2:00 AM by Neil

Chris,

What kind of build number format are you after? Chances are you can actually accomplish it using the AssemblyInfoTask as it ships: it's quite flexible and can be controlled in a myriad of ways using properties. For example, you can use any of the date formatting methods at http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx to control how the build number or revision number is formatted. Or, you can simply use an incrementing number for build instead of a date-based one.

The help file for the AssemblyInfoTask can be downloaded from http://www.gotdotnet.com/codegallery/codegallery.aspx?id=93d23e13-c653-4815-9e79-16107919f93e and lists all the different properties you can use.

If you find you can't get the formatting you want, please let us know at msbuild@microsoft.com.

Thanks,

Neil

# sell my house fast

Saturday, May 17, 2008 7:48 PM by sell my house fast

history has not dealt kindly with protracted periods of low risk premiums.

Leave a Comment

(required) 
(required) 
(optional)
(required)