Automatically increment SharePoint feature version number during build with build 2015

Nov 18, 2015

A few months ago Microsoft released a new automated build system with visual studio online /tfs 2015.

This new mechanism is way more open than previous XAML builds, tasks based and easier to customize.

One of the available tasks allows you to run a powershell script.

Let’s  say that for one reason you want to increment automatically the version number of your SharePoint features when building.

If you have a quick look at the “.feature” file you’ll notice that the version attribute looks like a serialized object (instead of simply being the version number), this is way more complicated than simply parsing a XML file.

If there is a well-documented solution for XAML builds, none exist for the new build mechanism.

https://blogs.msdn.com/b/sharepointdev/archive/2011/04/28/incrementing-the-feature-version-through-msbuild.aspx

So I took the time to find a solution and create a powershell script which does something similar and that you can customize to fit your needs. Have fun building stuff!

https://gist.github.com/baywet/de2fba740adb70332ca8


Last edited Sep 6, 2021 by Vincent


Tags: