Friday, March 10, 2006

Auto Increment Visual Studio 2005 Version Build and Revision via MSBuild Task





"Introduction
In Visual Studio 2005, the version numbers don’t auto increment when you build your project. Annoying? I think so. So I set out to find a way to do it. I did find some sample bits of code on the net that said it would do it, and while they did work to a point, they didn’t work well, or at all.


So, I set out to write my own using what I learned from the tutorials.

 

..."



Very cool. I do miss the auto incrementing build numbers from VB6.



I believe I understand why VS2005 doesn’t have the feature (each time to run the app it compiles, so your build number could increment much faster than you might expect, is my guess... i.e. a very different run/debug/compile process than VB6). Still that doesn’t mean I don’t want the feature...



Changing the build number in VS2005 is easier than VS2002/3 (though it’s not really hard there either), but incrementing my build numbers is very minor step that I’d rather not have to worry about. It’s a brainless, no decision process that is prefect for automation.



Hence my interest in this VB8 project. This post is not perfect for my purposes, but it takes me about 90-95% there (I don’t want my revision number incremented and the setup could be more automated. With some very minor updates, strong naming/GAC’ing it, then updating my project templates might just do the trick? Or maybe use Guidance Automation Toolkit [GAT]? Don’t know, but that’s what makes development so much fun...)



Source downloaded and added to my personal project list... ;)



Technorati Tags: , , , ,

No comments: