如何防止 Visual Studio 2010 劫持我的文件关联?
每当我运行 VS 2010 时,它似乎都会自动将其文件关联恢复为默认值。如果我退出 VS,并将文件扩展名关联到另一个应用程序,重新打开 VS 会将该文件扩展名劫持回自身。
特别是,我不想用 VS 打开 .asm 和 .inc 文件。我有另一个应用程序想要与这些文件类型一起使用。但是,一旦我为不相关的项目打开 Visual Studio 实例,VS 就会坚持劫持它们。
我尝试删除以下键:
HKLM\Software\Microsoft\VisualStudio\10.0\ShellFileAssociations\
但这并没有解决问题。有谁知道是什么原因导致这种情况发生,并且对如何阻止 Visual Studio 执行此操作有任何想法吗?
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 doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要确保这些文件扩展名与其他应用程序正确关联。
Visual Studio 将在启动时尝试修复任何损坏文件关联(未与任何有效应用程序关联的文件关联)。这意味着,如果您有它可以处理的孤立文件扩展名,它会将自身重新关联为打开这些文件的默认应用程序。如果它们已经映射到另一个有效的应用程序,它不会改变您的设置。
这也是为什么清除注册表项对您不起作用:下次启动 VS 时,它会恢复那里的信息,以便您获得正确的文件关联。
我从未见过它在正确配置后拒绝尊重您的设置。
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?