Shortcut to rebuild solution in Visual Studio 2008 - visual-studio

The shortcut to Build a solution in Visual Studio 2008 is Ctrl + Shift + B.
I would like to know the default shortcut to Rebuild the solution.

The command Build.RebuildSolution is not bound to any key combination in the standard profiles. However you can use the following trick to invoke it
Alt + B, R
This will navigate to the build menu via Alt + B and then R will select the Rebuild option

Another way is to do this:
Tools >> Options >> Environment >> Keyboard.
Locate the textbox decorated by the 'Show commands Containing' lable.
Type >> 'Build.Rebuild'
Select >> the rebuild type you want, you have two options to choose from.
Locate the textbox decorated by the 'Press shortcut Keys' lable.
Hit >> 'a key on your keyboard', i.e I used F6 for solution wide rebuild.
Click >> the assign button.
CLick >> O.K and to exit.
Finally load up a test project to test out the short cut.

In my installation, there is no default. I am configured for C#, it's possible other configurations will define this by default, but I don't think so. You can see if there is a key assigned by going to Tools -> Customize, clicking the Keyboard... button at the bottom and typing "Build.RebuildSolution" in the Show Commands Containing edit box. If there is a key assigned, it will show up at the bottom of the dialog.

There is no default shortcut to Rebuild Solution.
In addition to the ways mentioned in other answers you can perform the rebuild by
Create a Visual Studio Macro that rebuilds the solution and assign a keyboard shortcut to macro. The advantage of this approach is that you are no longer restricted by the commands provided in visual studio. You can create a custom operation like rebuild the solution, launch the application process and attach the visual studio debugger to the process. All this in a single keyboard shortcut!

Related

Set Add Class shortcut key in Visual Studio

I used to used the shortcut Ctrl + Shift + C to add a new class in Visual Studio 2015. This seems to have gone away when I'm using a different machine. How do I set this?
I've looked in Options > Environment > Keyboard but I can't see anything obvious...
Navigate to Tools >> Options >> Environment >> Keyboard, search for commands containing Project.AddClass and setup the shortcut you want
Steps to setup a shortcut
Search any command like AddClass in Show commands containing box
Select a desired command
Click on the blank Press shortcut keys box
Press desired key / key combination for shortcut using your keyboard
Also, see article Visual Studio Shortcuts and Add on Tools...
This article explains the same in more detail with some other interesting (and perhaps even relevant) points.

Why does VS2012 think my command keys are me attempting to edit code?

E.g. when I hit Ctrl-D, I for an immediate window, I have to move my mouse pointer out of the code window, or I get told I'm not allowed to edit code while it is running. I've only recently encountered this.
Not knowing how your Visual Studio is setup, I cannot say. However, try doing the following:
Open Visual Studio 2012 then go to Tools > Options...
In the Options menu, go to Environment > Keyboard.
From there, click inside the "Press shortcut keys:" input box and, using your keyboard, type CTRL + D. Once you do that, it will show you what command is currently using that shortcut.
Finally, type in the command name in the "Show commands containing:" input box. Click the command name from the list below, then click 'Remove'.
Hope this is what you are looking for! Let me know if you have any other questions!

How can I disable ReSharper in Visual Studio and enable it again?

I installed ReSharper, and it works in Visual Studio, but how can I disable it?
Whenever I search in the ReSharper menu, I can't find a disable option.
You can disable ReSharper 5 and newer versions by using the Suspend Now button in menu Tools → Options → ReSharper.
If you want to do it without clicking too much, open the Command Window (Ctrl + W, A) and type:
ReSharper_Suspend or ReSharper_Resume depending on what you want.
Or you can even set a keyboard shortcut for this purpose. In Visual Studio, go to Tools -> Options -> Environment -> Keyboard.
There you can assign a keyboard shortcut to ReSharper_Suspend and ReSharper_Resume.
The Command Window can also be opened with Ctrl + Alt + A, just in case you're in the editor.
Bind ReSharper_ToggleSuspended to a shortcut key.
Steps:
Tools>Options
Click Keyboard on the left hand side
Type "suspend" in the "Show commands containing:" input box
Pick the "ReSharper_ToggleSuspended"
Press shortcut keys: and
Press the "Assign" button.
Binding ReSharper_ToggleSuspended to a shortcut key (in my case: Ctrl-Shift-Q) works very well. With ReSharper not supporting the async CTP yet (as of mid-2011), when dipping into the code the uses the async keyword, this shortcut is invaluable.
I always forget how to do this and this is the top result on Google. IMO, none of the answers here are satisfactory.
So the next time I search this and to help others, here's how to do it and what the button looks like to toggle it:
Make sure Resharper is currently enabled or the commands may fail.
Open package manager console via the Quick Launch bar near the caption buttons to launch a PowerShell instance.
Enter the code below into the Package Manager Console Powershell instance:
If you want to add it to the standard toolbar:
$cmdBar = $dte.CommandBars.Item("Standard")
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"
If you want to add it to a new custom toolbar:
$toolbarType = [EnvDTE.vsCommandBarType]::vsCommandBarTypeToolbar
$cmdBar = $dte.Commands.AddCommandBar("Resharper", $toolbarType)
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"
If you mess up and need to start over, remove it with:
$ctrl.Delete($cmdBar)
$dte.Commands.RemoveCommandBar($cmdBar)
In addition to adding the button, you may wish to add the keyboard shortcut
ctrl+shift+Num -, ctrl+shift+Num - that is: ctrl+shift+-+-
EDIT:
Looks like StingyJack found the original post I found long ago. It never shows up when I do a google search for this
https://stackoverflow.com/a/41792417/16391
If resharper is completely missing from the options menu, it could be because the extension itself has been disabled.
In Visual Studio 2017 ReSharper 2018.X.X can be enabled and disabled by going to Help > Manage Visual Studio Performance. Then select JetBrains ReSharper ... under Extensions.
In Visual Studio 2019, you would go under Extensions->Manage Extensions->Installed
You can add a menu item to toggle ReSharper if you don't want to use the command window or a shortcut key. Sadly the ReSharper_ToggleSuspended command can't be directly added to a menu (there's an open issue on that), but it's easy enough to work around:
Create a macro like this:
Sub ToggleResharper()
DTE.ExecuteCommand("ReSharper_ToggleSuspended")
End Sub
Then add a menu item to run that macro:
Tools | Customize...
Choose the Commands tab
Choose the menu you want to put the item on
Click Add Command...
In the list on the left, choose "Macros"
In the resulting list on the right, choose the macro
Click OK
Highlight your new command in the list and click Modify Selection... to set the menu item text etc.
You need to goto Tools-->Options--->Select Resharper--->Click on suspend now,to disable it
Now Resharper supports Suspend & Resume argument at devenv.exe
(ReSharper 2019.2.3)
Run VS & Suspend R#:
devenv.exe /ReSharper.Suspend
Run VS & Resume R#:
devenv.exe /ReSharper.Resume
Here's an example usage:
In case the solution did not help to just suspend resharper (STRG+R, STRG+R did still not work for example) I decided to disable the plugin and restart visual studio.
VisualStudio > Extras > Extensions > Resharper > Disable
https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-diagnose-extension-performance
In ReSharper 8:
Tools -> Options -> ReSharper -> Suspend Now
For ReSharper 2017.2.2, go to ReSharper | Options | Product and features.
Tools -> Options -> ReSharper (Tick "Show All setting" if ReSharper option not available ). Then you can do Suspend or Resume. Hope it helps (I tested only in VS2005)
Very simple steps:
Go to Extensions → Manage Extensions
Click on Installed section at the top left and search for "resharper"
You will see disable button over the extension, click to it then restart Visual Studio and that's it!

Is there a hotkey in Visual Studio to open the member drop down list?

In Visual Studio there is a drop down list in the top right hand corner that you can use to navigate to the various members in the class. Does anyone know if there is a hot key to open this ddl?
I think you're looking for Ctrl + F2, which moves the cursor to the navigation bar at the top of a code view. From there, you can press Tab to move the cursor over to the member list.
For this (and pretty much every other Visual Studio hotkey/shortcut key combination), see here.
Visual Studio 2017+: They now support Resharper-like shortcuts. They work pretty well, too.
Ctrl+T - 'Go to All' (class/member/file), type m MyProp for members only
Alt+\ - 'Go to Member in current file'
Using VS 2008, I still don't know how to get directly to the Members dropdown which is what I want. But, the key bindings will be different for everyone. The command you want to search for under Options > Keyboard > Show commands containing: is Window.MoveToNavigationBar.
Assuming you are using the default keybindings packaged with Visual Studio, CTRL+F2 will focus the top-right drop-down list, and you can then navigate members by pressing TAB and using the arrow keys.
In my install of VS 2013, this is called Window.MoveToNaviationBar and is bound to Ctrl+F8. This is visual C++ settings.
Use Ctrl + F2 to get up there, then a click on Tab will get you to the member list instead of the object list.

Is there a shortcut key to switch between split panes in visual studio/management studio?

When I have a file open in visual studio/sql server management studio and have it split in to two panes, I'd like to be able to switch between the panes without having to reach for the mouse. Does anyone know if a shortcut key exists for this?
F6 is your friend.
I think you can assign this by going to Tools -> Options -> Keyboard and searching for SplitPane. You should be able to assign shortcut keys for the following values:
Window.NextSplitPane
Window.PreviousSplitPane
CTRL+F6 will cycle through your files and across panes.
In SSMS: right-click toolbars, customize. Under categories, select Window, then under Commands select "Next Split Pane". Drag to toolbar. Right-click and change name to "Next Split P&ane". You can now use alt-a to change split pane.
On Microsoft SQL Server Management Studio (SSMS) 2012, I figured out that it is the combination of Ctrl+Shift+UpArrow(or DownArrow). :-)
This was not easy for me for some reason. This method finally worked (similar to Steve Dignan's answer above but I don't have enough rep to comment yet).
In VS 2012, Tools, Options, Environment, Keyboard.
"Apply the following additional keyboard scheme" set to "Visual C# 2005".
"Use new shortcut in" set to 'Global'.
Enter "splitpane" in "Show commands containing" to get only the 2 desired commands.
Select the first one and remove any shortcuts already assigned.
Click inside the "Press shortcut keys" box and use "Ctrl + Alt + Up Arrow" for prev and down arrow for next.
If either of those shortcut chords are currently used by something else, you may need to search on that command and remove it from there. Then come back to the split pane commands and Assign.
Don't forget to close VS before you open another instance of it.
For Visual Studio 2010 (maybe others as well) F6 will work to jump between split panes if Tools -> Options -> Keyboard does not use the Visual C# 2005 keyboard layout additionally (which was the case for me for I-don't-know-why reasons - maybe I said yes to an installer/first-start question a long time ago).
Of course you will no longer be able to build your project with F6 afterwards. ;-)
For Visual Studio 2012: Tools -> Options -> Keyboard -> search by Window.Split and add a new shortcut.

Resources