25 Visual Studio Shortcuts For Developers

We use Visual Studio, the Microsoft’s Integrated Development Environment (IDE), to develop computer programs in .Net, such as windows applications, web applications, windows or web services. I have summarized the must know keyboard shortcut keys for developers to make .Net Development a bit easier and more productive. Let us have a quick walk-through over those now.

1. Start Debugging

This is the most used shortcut key by any developer using Visual Studio. Use the Function Key F5 to start debugging the solution. Need more shortcuts related to debugging the solution, look at the list below.

Stop Debugging - Shift (&) F5

Restart Debugging - Cntrl (&) Shift (&) F5

Start without Debugging - Cntrl (&) F5

2. Switch to Code View

Use the function key F7 to go back to code view from design view. This will take you back to the code behind file of the corresponding design file.

3. Switch to Design View

The combination Shift (&) F7 takes the user back to the designer view from the code behind file. This shortcut will work only from the code behind files.

4. Set or Remove Breakpoint

Use the key F9 to include a breakpoint in the current line. Press the key again to remove the breakpoint. F9 toggles the breakpoint in the current line.

5. View Properties

The function key F4 displays the properties window. If the cursor is in a designer file, the property window will display the properties for the control over which the cursor is currently positioned.

6. Step into a statement

While debugging normally F10 key is used to move to the next statement of execution. F10 always steps over the statement. If there is a method at the current line of debugger and for stepping the execution into the method, F11 can be used.

7. Go to definition of methods

Simply press the F12 key to get into the definition of methods, instead of doing the conventional way of right clicking and selecting the option from the resulting menu.

8. Show Solution Explorer

The combination of Cntrl (&) Alt (&) L can be used to view the solution explorer window. The solution explorer window displays the list of projects and files in the solution.

9. Show Server Explorer

The combination of Cntrl (&) Alt (&) S displays the server explore window which allows you to view and explore the database explorer and its related objects.

10. Show Immediate Window

Immediate Window is an excellent option to use while debugging to quickly view the contents of objects that are in scope of debugger session. Cntrl (&) Alt (&) I brings up the immediate window.

11. Open Quick Watch Window

Quick Watch is an option to explore an object while debugging. This window enables in depth analysis to be done on a particular object. Ctrl (&) Alt (&) Q can be used to bring the quick watch window.

12. Delete all Breakpoints

Cntrl (&) Shift (&) F9 deletes all the breakpoints in the solution. This is extremely useful when you need to delete all existing breakpoints before publishing the project to production.

13. Set Next Statement

A statement can be set as the next statement of execution in a debugger session by simply pressing the keys Cntrl (&) Shift (&) F10

14. Find Matching Text in Entire Solution

Cntrl (&) Shift (&) F brings up the Find in Solution window, that can be used to search for a text or word in the entire solution. This is a real mandate shortcut every developer should know.

15. Build Solution

A solution must be built to check if there are any errors in the code syntax. Building a solution is as simple as pressing Cntrl (&) Shift (&) B keys.

16. Save all Files

All the edited and unsaved files in a solution can be simply saved by pressing Cntrl (&) Alt (&) S keys.

17. Navigate between Files

Every developer need to navigate between different files during coding. One can navigate to any open file in the solution by using the keys Ctnrl (&) Tab and select the one that needs to brought to focus.

18. Comment Selected Lines

Select the lines of code or place the cursor in a line and comment those by using the combination Cntrl (&) K (&) C.

19. Uncomment Selected Lines

Lines of code can be uncommented by either selecting the bunch of code or placing the cursor on the line to comment and pressing the keys Cntrl (&) Alt (&) U.

20. Format Current Document

The designer and code behind files can be formatted by using the keys Cntrl (&) K (&) D. This arranges the lines of code in a structured manner.

21. Format Current Selection

As mentioned above, the entire document can be formatted using Cntrl (&) K (&) D. Sometimes formatting the whole document, especially the designer pages can cause some issues or confusion while comparing different versions of code. If only a part of the code in the file needs to be document, then the keys Cntrl (&) K (&) F can be used.

22. Toggle all Outlining

Toggling outlining can be done by using the keys Cntrl (&) M (&) L. For pages having large chunk of codes, toggling outlining enables to have a quick glance at the page.

23. Collapse to Definitions

Collapsing list of events and methods to its definitions always provides a meaningful explanation of the page in a quick glance. This can be achieved using the keys Cntrl (&) M (&) O.

24. Open Search Terms Window

Here comes my personal favourite. To open up a particular page in the solution, we need to expand the folder structure in solution explorer, navigate to the file and open it. Instead, this search term window can be used to it 10 times faster. Press Cntrl (&) , (comma). This opens up the search term window as shown in the screen shot below. Type in the name of the file that you want to open. The window will list out the list of matching files, just double click the desired file to open it up.

25. Match Ending Curly Brace

To quickly check the end of the current open brace in a code file, first place the cursor in the open curly brace ( { ) in the code, the press Cntrl (&) }, you will be taken to the line of code where the closing bracket of the current opened brace exists. This tip helps to solve some missing closing brace errors quickly.