Saturday, March 11, 2006

Release me

I know how many people read my blog, its about 5 tops. And i know at most one of them will be interested in what I'm about to blog about, but its bothering me very much and I want to blog it. I will try and explain for those of you who are unfamiliar with the subject material.

Visual Studio is the microsoft app I use to program in. The same way somebody would use MS Word to write up a letter or report, I use MS Visual Studio 2005 to write up a program. There are by default, two different configurations you can work in when using VS. Debug, and Release. The Debug configuration creates bloated and slower code, but allows you to -- using a debugger -- step through your program line by line and become intimately familiar with how it is behaving. The release configuration creates applications that are quicker and smaller, but doesn't allow you to debug them.

Visual studio also has built in support for creating installers for your programs. So with a few clicks, you specify which of your many projects in your program is the top level, main point of entry, however you wanna say it. The primary project. And the built in installer project then goes off and finds everything else that your primary project needs to be installed with it. When you do this, you must specify to the installer project if you want to include Debug or Release versions of your code. You can also just specify the "Active" configuration, which means whatever configuration you are currently in, when you build all your code into a program, thats the configuration the installer will use.


What actually happens when you select "Active" configuration is VS adds all the code in your active configuration, and leaves it that way regardless of what you switch too. So if you setup your installer project in Release mode, then switch to debug mode, and rebuild your installer project, all of the projects will still be included according to their Release versions. Which means not only can you not debug it, but any changes you've made to your code in Debug mode will take effect in the installed version of your application until you switch back to release mode and rebuild all your shit!

Bad Microsoft! Very bad!

Another annoying point, but defendable from microsofts point of view, is that the installer will use any code you have in the Global Assembly Cache before it uses anything in your particular project. So if you are developing Application X, and you also happen to have this application installed on your computer and in your GAC (maybe you tested out the installer), then when you make changes to your code and rebuild your installer, it will actually include the version of your code in the GAC, not the one with all the changes you just made in your project.