Automatically use subversion revision as version in .Net projects
26. April 2011After a long search I discovered the „Build Version Increment Add-In“ (for Visual Studio 2005, 2008 and 2010) which enables to auto increment the build version of the AssemblyFileVersion attribute – currently C#, VB.NET and C++.NET projects are supported. The Add-In is quickly installed and comes with various incrementor styles. But I missed an incrementor style which provides the subversion revision if the project is under version control. Luckily the Add-In exposes an interface for creating own incrementor styles: After some hacking I got it working using Sharpsvn to get the revision.
The final plug-in for the Add-In is available for download here: SubversionIncrementor v1.0
Some users report to have issues using the Build Version Incrementor (version 2.4) with Visual Studio 2010 SP1 or Visual Studio Ultimate 2010: I also had that issue but building the whole project solved it. If you don’t want to rebuild the whole project the version is also available for download here.
Update 15.09.2011:
I’ve updated the Plugin to work with Build Version Incrementor (version 2.5) and fixed a bug which prevented the SubversionIncrementor to get the revision when not conncted to the subversion server.
The new plug-in for the Add-In is available for download here: SubversionIncrementor v1.1
Update 30.10.2012:
I’ve updated the Plugin to work with the latest SharpSVN version that supports the 1.7 working copy format and the latest Build Version Incrementor (version 2.5.11219.2200).
The new plug-in for the Add-In is available for download here: SubversionIncrementor v1.2
Update 11.11.2012:
Now you can get the sources of the plugin from: https://github.com/crea-doo/Subversion.Incrementor
Update 18.07.2013:
I’ve updated the Plugin to work with the latest SharpSVN version that supports the 1.8 working copy format and the latest Build Version Incrementor (version 2.5.11219.2200).
The new plug-in for the Add-In is available for download here: SubversionIncrementor v1.3