TheSoftwareJedi
TheSoftwareJedi

Reputation: 35236

Visual Studio hot keys change occasionally, specifically F6 vs Ctrl-Shift-B for building. WHY?

I always press F6 to build my project. Suddenly some of my Visual Studio instances are wanting me to use Ctrl-Shift-B. It's not keyboard related - the actual text of the menu option changes from "F6" to "Ctrl-Shift-B".

Any answers as to how to fix, and what causes this?

Upvotes: 105

Views: 37194

Answers (11)

Roli Kreis
Roli Kreis

Reputation: 41

Visual Studio 2019, default keyboard mapping scheme is "Visual C# 2005"

When I open a Git repo as a folder (NOT open a VS solution), the "Build Solution" shortcut is Shift+F6 (which does nothing, because there isn't a solution open, which can be built)

As soon as I open a VS solution, the "Build Solution" shortcut changes to F6.

So please check: Did you open a VS solution, or is a Git repo only open "as a folder"?

Upvotes: 0

0xBADF00D
0xBADF00D

Reputation: 1034

I had TPFanControl installed which captured Ctrl+Shift+B globally. I used a tool mentioned in this answere to find out which program registered for which shortcuts.

Upvotes: 1

Stefano Pagana
Stefano Pagana

Reputation: 16

Tools -> Options -> Environment -> Keyboard

search this command: "ClassViewContextMenus.ClassViewProjectBuild"

Assign F6

Upvotes: 0

CYBERNARESH
CYBERNARESH

Reputation: 466

This is because you might have selected "General Development Settings" as your default environment settings for your Visual Studio (which usually we do on the first launch of VS after installing it as it pops up a dialogue box to choose default environment settings).

If you only want to change the keyboard hotkeys settings, you just follow the solution proposed by others (Tools > Options > Environment > Keyboard > Visual C# 2015). BUT this will only change the keyboard settings to C# settings while keeping rest of the settings as General settings only.

If you are really intending to change complete environment to C# settings, then follow this approach.

SOLUTION 1:

  1. Go to "Tools" (menu)
  2. "Import and Export Settings"
  3. "Import selected environment settings"
  4. Either select "Yes, save my current settings" or "No, just import new settings, overwriting my current settings"
  5. "Which collection of settings do you want to import?"
  6. Under "Default Settings" tree select "Visual C#" node (you might see a yellow warning sign, NO need to worry about it) and then click "Finish" button.

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 :)

Upvotes: 41

Elaskanator
Elaskanator

Reputation: 1216

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"

Upvotes: 0

domenu
domenu

Reputation: 455

You can reassign SHIFT + F6 to build the current project only:

1/ Go to Tools -> Options -> Environment -> Keyboard

2/ Show commands containing: Build.BuildSelection

3/ Focus the field Press shortcut keys & press Shift + F6 to assign it

Upvotes: 4

Chris Harden
Chris Harden

Reputation: 366

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.

Upvotes: 10

CAD bloke
CAD bloke

Reputation: 8828

Notepad++'s NPPscripting plugin broke Ctrl-Shift-B for my whole OS while NP++ was running. Uninstalling the plugin (I had to delete the DLL manually from the Notepad++ plugins folder) fixed the broken key mapping for me.

Upvotes: 2

Nick Whaley
Nick Whaley

Reputation: 2799

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.

Upvotes: 6

ScottCher
ScottCher

Reputation: 14939

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?

Upvotes: 69

stuartd
stuartd

Reputation: 73303

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

Upvotes: 58

Related Questions