Hidden feature of VSIP: Sharing a machine

Okay so this really isn't a debugger feature, but I thought it was handy anyway.

Yesterday a colleague and I were both logged onto the same machine, both using Visual Studio as two different users. Since I work at Microsoft, I naturally needed to change Visual Studio. So how to do that without having my co-worker log off (because he had the same dlls loaded I needed to change)?

Registry hives

VSIP (well actually Visual Studio) has this nifty idea where you can load devenv using a different root key in the registry. The intent here is that when you are developing a Visual Studio package you can build the package in one instance of Visual Studio and run in another. This means the package is not loaded in the same environment you are building in. Very handy when your package causes Visual Studio to crash. How would you debug it if you can't even start Visual Studio?

 So most of the time (at least in my past) people use the Exp hive. If you look in your registry, you'll have a root install of HKLM\Software\Microsoft\VisualStudio\8.0. The Exp hive lives at HKLM\Software\Microsoft\VisualStudio\8.0Exp. If you install your package in just the Exp hive, you can run the Exp version and debug with the normal.

Package redirect

So how did I use this exp hive to my advantage?

Packages are loaded dynamically as devenv needs them (usually when a command or window from the package is called). The location for these packages is stored in the registry underneath the root location for Visual Studio (i.e. HKLM\Software\Microsoft\VisualStudio\8.0\Packages\{package guid}).

For example, the debugger package (which is what I wanted to change) is loaded from here:

Since my colleague was using the 9.0 hive, I could just change the package load location for my Exp hive and have my version of devenv load a different dll!

Something like so: