You may have wondered what that Restore File Associations button does on the Tools-Options-Environment page.  This button allows you to restore your file extensions for VS 2005, in case any were broken after uninstalling a previous version of Visual Studio or if a 3rd-party tool reregistered an extension.  In other words, this button updates all VS-related files extensions to work with the VS 2005 version.

How it works

In the registry, under HKLM\Software\Microsoft\VisualStudio\8.0\ShellFileAssociations, you’ll find a listing of all the extensions Visual Studio 2005 cares about.  Should an uninstall of a previous version of Visual Studio, or anything else happen to unregister these file extensions, the “Restore File Associations” button will restore HKCR with the information found under ShellFileAssociations.

When to use

You’ve uninstalled VS 2003 and are noticing issues with your file associations.

You’ve installed a 3rd party tool that reregisters your file extensions and you want them to be re-associated with Visual Studio 2005.

VS 2005 Self-Repairing

When possible, Visual Studio will attempt to repair any broken file associations (those not associated with a valid application) at startup.  Let’s say I delete the file association information for .vb in HKCR (please don’t try this at home).  The next time I start VS 2005, it will restore the information in HKCR, so you get the correct file associations from here on out.

Happy Visual Studio’ing!