VisualStudio 的热键偶尔会发生变化,特别是 F6和 Ctrl-Shift-B。为什么?

我总是按 F6来构建我的项目。突然,我的一些 VisualStudio 实例希望我使用 Ctrl-Shift-B。它与键盘无关-菜单选项的实际文本从“ F6”变为“ Ctrl-Shift-B”。

关于如何修复和 是什么导致了这一切有什么答案吗?

35817 次浏览

Your keyboard scheme has changed - go to Tools/Options/Environment/Keyboard and set the default keyboard scheme to 'Visual C# 2005'

Keyboard mapping corruption issue perhaps? Check Tools / Options, Environment / Keyboard. Should see a drop-down for your Keyboard mapping scheme and next to it a Reset button. Hit the reset button.

I'm not responsible for this screwing with your settings - save them prior to doing this just in case you screw the pooch.

Oh, in case the narcs out there care, I think this is a valid question and would be put out if someone voted to close it. Of course now that I've said that, its a certaintity, isn't it?

Its because you installed VMWare. It remaps that key so that F6 can be used to start debugging on a virtual machine.

Annoyed me too.

If you have other key bindings and dont want to reset the lot use: Tools -> Options -> Environment -> Keyboard

Then find Build.BuildSolution or Build.RebuildSolution (on your preference) select Global in the Use shortcut in dropdown, place the cursor in Press Shortcut Key and slap F6. It'll show you what it is currently assigned to, for me is was to traverse split panes (maybe it overrides F6 when you use split panes for the first time? I've always wondered why my home development machine built with F6 and my work one doesn't and come to think of it I've never used split panes at home) then hit Assign.

当NP++运行时,Notepad++的NPPScripting插件破坏了我的整个操作系统的Ctrl-Shift-B。卸载插件(我不得不从Notepad++插件文件夹中手动删除DLL)为我修复了损坏的键映射。

您只能重新分配SHIFT+F6来生成当前项目:

1/转到Tools -> Options -> Environment -> Keyboard

2/show命令包含:abc0

3/关注字段Press shortcut keys&;按Shift+F6进行分配

我安装了TPFanControl,它可以全局捕获Ctrl+Shift+B。我使用了这个答案中提到的一个工具来找出哪个程序注册了哪些快捷方式。

这是因为您可能已经选择了“ General Development Settings ”作为Visual Studio的默认环境设置(通常我们在安装VS后第一次启动时会这样做,因为它会弹出一个对话框来选择默认环境设置)。

如果您只想更改键盘热键设置,您只需遵循其他人提出的解决方案(工具>选项>环境>键盘>Visual C#2015)。可是这只会将键盘设置更改为C#设置,而将其余设置仅保留为常规设置。

如果您确实打算将整个环境更改为C#设置,那么请遵循此方法。

解决方案1:

  1. 转到“工具”(菜单)
  2. “导入和导出设置”
  3. “导入选定的环境设置”
  4. 选择“是,保存当前设置”或“否,仅导入新设置,覆盖当前设置”
  5. “要导入哪个设置集合?”
  6. 在“默认设置”树下选择“ Visual C#”节点(您可能会看到一个黄色警告标志,无需担心),然后单击“完成”按钮。

or you can do the same like

SOLUTION 2:

  1. Go to "Tools" (menu)
  2. "Import and Export Settings"
  3. "Reset all settings"
  4. Either select "Yes, save my current settings" or "No, just import new settings, overwriting my current settings"
  5. Select "Visual C#" from the list and then click "Finish" button.

Both approaches would give you the same result of changing your complete environment to 'Visual C#" there onward.

Enjoy Coding :)

I had a stale build in my solution (included libraries were apparently using old DLL versions and I was getting MissingMethodException's at runtime) so I deleted all the \bin directories in my C# projects, restarted Visual Studio, and suddenly this issue is now affecting me for the first time in the 3+ years since I started using Visual Studio.

No clue how this could have affected my user settings, but it apparently did. They went from using the "Visual C# 2005" keyboard profile to "default"

Tools -> Options -> Environment -> Keyboard

search this command: "ClassViewContextMenus.ClassViewProjectBuild"

Assign F6