Sunday 22 October 2006

ASP.NET Build numbers

Jeff
Whilst building my website for deployment I did some research on creating build numbers.
I wanted to use the Major.Minor.Build.Revision format where :
Major = the major release version. This is only changed when major changes are made to the application.
Minor = the minor release version. This is changed for small changes such as user requests, bug fixes.
Build = the build number. This is constructed by the date of the build e.g. if a build is completed on 1st August 2006 the build number would be 60801, that is YYMMDD.
Revision = the revision of the build. This is incremented every time a build is carried out on the same day. So when the first build of the day is performed it will be a 0, then if another build is made on the same day it will increment to 1 and so on.

Obviously I wanted to automate this using a build task as part of my Web Deployment Project.
For class library's this is quite easily done by using AssemblyInfoTask module written by the MSBuild team. Once installed a help document for the module can be found at [Program Files]\MSBuild\Microsoft\AssemblyInfoTask and this explains quite well how to use this module with your build.
For the Web site build I followed this blog which seems to work well.

No comments: