All Your RegKeys Are Belong To Us
I’ve been in many discussions lately with various folks about Visual Studio 2010 extensibility. Inevitably, someone suggests a solution to some problem involving changing/adding/deleting a registry key/value for an extension. If you need to do this, just remember this one rule:
Do not ever edit a key that ends in “_Config”
This key contains your user-specific settings and works the same as it has in prior VS releases. This could be things like pointers to your default project locations, window layout data, etc… In general it is OK to make tweaks to this key. The worst thing that could happen is that you end up corrupting your user settings. Deleting the key will cause the first-launch “Please choose a profile” dialog to come up the next time you launch Visual Studio.
If you examine the contents of this key, you’ll see that it contains the configuration data for VS 2010. This includes things like package registration, project system registration, editor factory registration, etc… You may also notice that the contents are very similar to HKLM\Software\Microsoft\VisualStudio\10.0.
You can think of the _Config key as a volatile cache of VS’s configuration data for a particular user. It is simply the combination of HKLM\Software\Microsoft\VisualStudio\10.0 and any pkgdef files coming from VS extensions (either from Common7\IDE\Extensions or %LocalAppData%\Microsoft\VisualStudio\10.0\Extensions).
If you edit a key in 10.0_Config, Visual Studio will (quite possibly) delete it on startup.
If you need to change a value, always do one of the following:
- Edit the value under HKLM\Software\Microsoft\VisualStudio\10.0
- Edit (or add) a pkgdef file for the extension in question (For managed VSPackages, this is likely editing/adding a RegistrationAttribute in your code).