If you use NAnt to manage your build cycle, there’s a great extension called NAntContrib. It has a bunch of extension tasks to help manage your build more easily.
Among them is the awesome <version> tag, which allows you to automatically increment your version number every build. To add it, simply add into your target:
<version buildtype="Increment" revisiontype="Increment"/>
Run NAnt, and viola! You’re presented with this un-helpful and frustrating error message:
Unable to read version number from "build.number".
Could not find file 'build.number'.
Worse yet, creating an empty build.number file makes NAnt tell you the format is invalid. And googling reveals nothing.
As it turns out, the enigmatic format required is very simple: it’s a four-part version number typical of .NET assemblies. Simply start off with 1.0.0.0 and your build works. Hooray! Thanks for nothing, NAnt!
Hi,
I still get the same error, even after installing NantContrib extension.
Can you tell me where I have to install NantContrib?
@pranav sorry, I don’t know. If it’s not in the right directory, NAnt will complain that it can’t find C:\Some\path\to\NAntContrib.dll. That should suffice.