How do I prevent Visual Studio 2010 from hijacking my file associations?
VS 2010 seems to automatically restore its file associations to the default whenever I run it. If I exit VS, and associate a file extension to another application, re-opening VS will hijack that file extension back to itself.
In particular, I don't want to be opening .asm and .inc files with VS. I have another application that I want to use with those file types. But VS insists on hijacking them as soon as I open an instance of Visual Studio for an unrelated project.
I have tried deleting the keys in:
HKLM\Software\Microsoft\VisualStudio\10.0\ShellFileAssociations\
however this did not fix the issue. Does anyone know what is causing this to happen, and have any ideas on how I can prevent Visual Studio from d开发者_开发百科oing this?
You need to make sure that those file extensions are correctly associated with another application.
Visual Studio will attempt to repair any broken file associations (those that are not associated with any valid application) at startup. That means if you have orphan file extensions that it can handle, it will reassociate itself as the default application to open those files. If they are already mapped to another valid application, it won't alter your settings.
This is also why clearing the Registry key isn't working for you: the next time you start VS, it restores the information there so that you get the correct file associations.
I've never seen it refuse to respect your settings when configured correctly.
Are you using Control Panel "Control Panel\Programs\Default Programs\Set Associations" to set the associations to some other program?
精彩评论