Best Practices for Using Feature Versions
Last modified: July 12, 2010
Applies to: SharePoint Foundation 2010
Feature versions in Microsoft SharePoint Foundation are used to trigger Feature upgrade. If you update your Feature version but do not specify any Feature upgrade logic in the Feature.xml file, when the Feature upgrade runs, it simply updates the version number of your Feature. However, if you specify Feature upgrade logic, the upgrade code is executed and the version number is automatically updated as well.
The following guidelines describe best practices for implementing Feature version numbers:
Increase the version number when you update a Feature and, if needed, add corresponding Feature upgrade logic. Even if you do not have to add Feature upgrade logic, you should still increase the version number so there is a way to distinguish what versions of the Feature are deployed across a server farm.
Keep version numbers of your Feature independent from Microsoft product versions. For example, instead of starting with 126.96.36.199 as the version number, start with 188.8.131.52 and increment subsequent versions appropriately, for example, 184.108.40.206, 220.127.116.11, and so on.
Increment a major version number to the current major product version the first time you create or change a Feature during a new development cycle, and reset all remaining digits to zero (for example, 18.104.22.168).
Increment the build version for subsequent changes during a development cycle. The build version is indicated by the 3rd digit of the build number (for example, 22.214.171.124, 126.96.36.199, and so on). When you increment the build version number (3rd digit) rather than the minor version number (2nd digit) you gain maximum versioning flexibility.
For an initial service pack change, increment the minor version, which is indicated by the 2nd digit, to match the service pack number, and then reset the digits that follow to zero (for example, 188.8.131.52 for the first service pack, 184.108.40.206 for the second service pack, and so on). For incremental changes to a service pack, increment the build version, which is the 3rd digit (for example, 220.127.116.11, 18.104.22.168, 22.214.171.124, and so on).