☑ Auto-Incrementing Build Version Macro for VS.NET (2003)

A few years ago I added a macro to my installation of Visual Studio 2003 to automatically increment the build number whenever I re-built the project. It worked just fine, closing any resources if open, without the warning about the resources being opened outside of the dev-env, and without having to move the version block to an RC2 file.

I recently had to repair my installation and have lost that macro. I have searched everywhere and cannot for the life of me find it. I have checked my drive to see if I can find the file to reinstall it, but the only candidates that it could be turned out to not work. The Internet has likewise proven fruitless. Most of the available ones are now for VS2005 and VS2008.

Does anyone know of a VS2003 macro that closes open resources and automatically increments the version number in the RC file on building?

2 thoughts to “☑ Auto-Incrementing Build Version Macro for VS.NET (2003)”

  1. Never mind, I found it.

    I compiled a list of all the RC files from all of my projects and examined them to see at what point they started auto-incrementing the build number. Once I had found the two projects, one which had a static number (1) and the other an increasing one, I examine their dates. Using that I determined that I had installed the macro in March 2007 (more recent that I had thought). I then did a global search for all files that were created or modified in that month, and bam!, there it was: IncBuildNrMacro.zip.

    It turned out to be exactly the one that I had thought it was all along, Roman Komary’s IncBuildNrMacro. Now that I knew for sure it was indeed this one, I tested it again. Unfortunately, while it did not give the warning, it only incremented the version if no resources had been opened in the editor since the solution was opened.

    I carefully read through all of the comments on its page to find a solution. I tried out Kamziki’s proposed modification to the code (which I could have sworn I had already tried without success, and certainly don’t remember making any changes the first time I installed it last year). I made the change and sure enough it works perfectly again. 🙂

    I’ve copied the modification and put it along with the original macro in a safe place for future use.

  2. Well it is still working, however now and then it seems to get messed up and VS.NET 2003 gives me the reload-file-since-it-was-modified-outside-the-editor prompt. Quitting VS and running it again fixes it, but I’m fairly certain that it never did that in the past. Of course, this current installation of VS is pretty corrupted and messed up. It works, but there has been so many changes and so much damage to it that I cannot say anything to any successes or failures. I will check it again when I eventually restore to a previous, fresh install.

Leave a Reply

Your email address will not be published.

four × 5 =