Is there any reason to use one versioning style over the other for .NET assemblies????
I'd like to know if there are any advantages/disadvantages in using either style besides taste.
Is there any reason to use one versioning style over the other for .NET assemblies????
I'd like to know if there are any advantages/disadvantages in using either style besides taste.
The advantage of time is that you get both an increasing version number and encode the timestamp.
The advantage of using more traditional numbers is that it's easier for people to understand. We all know roughly what "v2.1" means, for example.
In general I suggest using time because the added information is useful. The advantage of the other numbers is for marketing only, and for that you can do it anyway.
For example, why not have both, a la "v2.1.20090214." Now you have marketing in the major.minor section and utility in the "build" section.
I just leave the AssemblyVersion at "1.0.*" and remove any AssemblyFileVersion.
I can then increment the Major and Minor version numbers as seems appropriate and let the default DateTime base build and revision be automatically set.
Unless you have alternative build tools controling the build and revision number according to some other scheme I can see no real advantage to setting them manually.
I use some build scripts that update my revision based on the SVN revision. That makes it trivial to track a dll back to the source code that created it.
Time is trickier; you have to start looking in the history pane - where-as most source control tools have a "get revision " facility.
Why choose? You can use a format such as Major.Minor.YYMMDD.Revision and get the best of both worlds.
Edit As pointed out in the comments sometimes the range of each field is restricted. In that case you can use Major.Minor.YMMDD.Revision.
Hopefully you would change minor version at least every 10 years!
One disadvantage of date-based version numbering is the negative perception of old software.
Although, I use it anyway because it fits my projects very well.
Using time/date has one more (apart from those already mentioned in other answers here) disadvantage:
if you're dev team is spread over different time zones, you'll never be sure which one of two versions build one hour apart is the newer one. Unless you also version the timezone or force the date/time to be in e.g. GMT.
The advantage of using major.minor.revision scheme is semantics. There's a method to updating each of these numbers:
Major number change means that the new version is incompatible with the old one and any dependent of the prior version will require code changes to upgrade to the new package.
Minor number change means that the new version is backward compatible with the previous version but has significant enhancements over the previous version.
Revision number is updated whenever a bugfix is applied to the build such that it doesn't bring a compatibility change or introduce newer features.
While specifying dependencies, you can thus say that you depend on foo-1.0.0 - foo-1.99.999, and rest assured that you won't end up with a package upgrade that breaks your application.
If you started with a higher minor version of a dependency, say, foo-1.4.22, you should specify the dependency as foo-1.4.22 - foo-1.99.999, so that you don't end up installing a version older than 1.4.x, which might have some functionality/enhancement missing from it.