Visual Studio and ReSharper favorite keyboard shortcuts and snippets

These commands applies to Visual Studio 2012. Probably 2010 and 2013 will work fine too. The Resharper commands are using standard “Visual Studio” keyboard scheme.

Resharper

Used often
Shift+Alt+L (Locate current file in Solution Explorer)
Alt+F7 (Find usages of a class, method or variable in solution)
Ctrl+Click (Goto definition)
Alt+(+) (Alt and plus-key, find members within current file)
Ctrl+T (Goto type, symbol or file name)
Alt+Shift+T (Goto symbol)
Ctrl+Alt+Space (Smart autocomplete for current code)
Alt+Enter (Action list for code at caret)
Ctrl+Shift+R (Refactor this, selected text)

Used rarely
Ctrl+Shift+F1 Quick documentation (e.g. small help window for current html/code at caret)
Ctrl+R+R (Rename type/symbol with preview)
Ctrl+Shift+T (Goto file)
Ctrl+, (Recent files)
Ctrl+Shift+, (Recent edits)

Visual Studio

Used often
Ctrl+F (Find in current file)
Ctrl+Shift+F (Find in files)
Ctrl+K, Ctrl+D (Format document)
Ctrl+K, Ctrl+F (Format selection)
Ctrl+K, Ctrl+C Comment line/selection
Ctrl+K, Ctrl+U Uncomment line/selection
Ctrl+Click (With popular extensions Goto definition or Productivity Power Tools)
F12 (Goto definition)
Ctrl+L (Remove line/selection)
Ctrl+D (Duplicate line/selection)
Ctrl+G (Goto line)
Ctrl+Mousewheel (Set editor zoomlevel, a great plugin that keeps zoomlevel consistent in all windows is TroutZoom)

Used rarely
Alt+F1 (MSDN documentation)
Ctrl+Q (Quickfind vs2012+ and with some extension vs2010)
Alt + Select vertical lines with mouse (Expands caret across several lines, insert text on several lines simultaneously)
Ctrl+shift+alt up/down move symbol (e.g method, props etc. within current class/file)
Ctrl+shift+alt left/right move method parameters within method definition.
Ctrl+B (Toggle breakpoint)
Ctrl+Alt+B (Breakpoints list)
Back and forward mouse button (goto to prev/next edit code position)
Ctrl+K, Ctrl+X (Insert snippet)
Left mouse button “triple click” – (Select entire line in vs2012+)

Snippets (enter text and then double tab-key):

nguid – Insert new GUID (Inside a string type: “nguid” and press tab tab)
prop – Insert a shorthand get set property
propfull – Insert a complete get set property with backing private field
ctor – create an parameterless constructor in the class.

Custom keyboard shortcuts

You can add your own keyboard shortcuts through Tools -> Options -> Environment -> Keyboard.
I have added the following:
Ctrl+Alt+B (Build.BuildSelection – this builds the “current” project and not the entire solution).
Ctrl+F12 (Tools.AttachtoIIS – this is a Visual Studio plugin, AttachTo which attaches the debugger to the projects IIS website)
Ctrl+Shift+G (Set keyboard shortcut to Edit.NavigateTo)

To customize the next and previous position re-map keyboard shortcuts to View.NavigateBackward and View.NavigateForward respectively. Use  Ctrl+(-) (Ctrl and minuskey, navigate to previous position) Ctrl+(+) (Ctrl and pluskey, navigate to next position) for instance.

ReSharper Visual Studio scheme keymap

New to ReSharper? A great tip from a colleague of mine is to try to learn a few keyboard shortcuts everyday. 
https://www.jetbrains.com/resharper/docs/ReSharper80DefaultKeymap_VS_scheme.pdf

Visual Studio 2015 PerfTips: Performance Information at-a-glance while Debugging with Visual Studio – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs

PerfTips: Performance Information at-a-glance while Debugging with Visual Studio – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs.

Seeing function return values in the Visual Studio 2013 debugger – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs

Seeing function return values in the Visual Studio 2013 debugger – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs.

Visual Studio 2013 really slow when pasting inside ASPX files solved

Whenever I pasted some code in my aspx pages inside Visual Studio got this dialog:
ScreenShot1162

To solve this, I just deleted all the files from this folder:
%USERPROFILE%\AppData\Local\Microsoft\WebSiteCache

Perhaps do a backup first (zip file etc).

Solution from here:
via Slow Visual Studio Performance … Solved! | Geocortex Blog.

ide – Visual Studio 2013 Update 2 – C# navigation bar drop down menus not working – Stack Overflow

The dropdown menus in the code editor stopped working in Visual Studio 2013 for me.
The problem is a bug when using multiple monitors and a “leftmost” monitor that is not the “main” display…

The solution is quite simple for now: make your leftmost monitor the main monitor.
A bugfix is coming, included in next Visual Studio update.

More info:

ide – Visual Studio 2013 Update 2 – C# navigation bar drop down menus not working – Stack Overflow.

How to update a wsdl definition in Visual Studio Website project

Put new wsdl file in website root ~/Services

Goto “project” -> Service References folder ->
Select the particular web service -> right click and choose
“Update service reference”

Visual Studio builds new references against this definition and
updates some files inside the service folder *.svcinfo, Reference.cs, Reference.svcmap, app.config in the project base folder.

Rebuild solution.

TroutZoom extension – syncs zoom level in vs2012 vs2013

Syncs zoom level across all windows in Visual Studio, works in vs2012 and vs2013

TroutZoom FreeThis extension manages the zoom levels for the code windows. When the zoom level is changed in one document, it gets changed for other open documents and any new documents that are opened.

via TroutZoom extension.

 

Tips for Visual Studio 2013 — Visual Studio Magazine

Peek Definition (Alt+F12) provides you the benefits of Go To Definition without actually taking you anywhere. It opens the code file and displays the referenced definition directly beneath the line on which you’re focused, pushing your code lines down so it doesn’t cover them up. And if you drill down again, you get a second page in the Peek Definition window containing that referenced definition.

In Visual Studio 2013, you can now drag and drop code using the arrow keys. The trick is to hold down the Alt key.

To move lines with the keyboard:
Move your cursor anywhere within the line. You don’t have to select the entire line.

Hold the Alt key and press the up or down arrow keys until the line is where you want it.

To move multiple lines with the keyboard:
Select any portion of a set of lines. (Shift+Arrow Up/ArrowDown)

Hold the Alt key and press the up or down arrow keys until the lines are where you want them.

via 6 Top Tips for Visual Studio 2013 — Visual Studio Magazine.