What does that Restore File Associations button do on the Tools-Options-Environment page?

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!

Comments (6)

  1. Norman Diamond says:

    You mean it’s not for use when security systems break and you find the environment under two metres of water? Doesn’t it restore _anything_?

  2. astebner says:

    We’ve seen lots of uninstall issues related to file associations in VS 2002 and 2003. This is great to see that there is an easy way to fix file associations in VS 2005.

    As a side question – is there any way of repairing file associations for VS 2002 and 2003? I don’t know of a feature like this in the older versions of the IDE, but do you know of any steps that would do the equivalent of this button? I don’t see a ShellFileAssociations registry value for VS 2002/2003 so I’m guessing it is going to be more complicated for those customers.

  3. Michael Wynne says:

    "…is there any way of repairing file associations for VS 2002 and 2003?"

    I too would like to know this as I use VS2003 for the majority of my development and recently installed and then uninstalled VS2005 and all my file associations for VS2003 vanished. I’m yet to find an easy way to restore them all. Any ideas?

    Thanks, Mike.

  4. Myself says:

    IOW, when you manually set the file associations using Explorer, VS in its infinite wisdom decides "nah, he didn’t really want to do that, I’ll change them back again." Idiocy.

  5. Vincent Randal says:

    I want to go back to my old VC 6 (pre .NET) and cannot successfully reinstall it, because I believe VC Express 2005 uninstall went wrong. Main problem I notice is the output from "assoc" shows lots of file extensions still associated with VCExpress, but not when I view file types in Explorer. Which one’s right? How do I clean up the mess left behind by the VC Express 2005 uninstall? Reinstall it then uninstall it?

  6. John Dolinka says:

    helpful page

Skip to main content