In this blog post, we will learn about the important debugging shortcuts of Visual Studio 2019 which comes really handy while debugging an application and also helps to increase productivity.
Visual Studio 2019 is one of the best developer-friendly Integrated Development Environment (IDE). The IDE has tons of features that help to ease the development process. These features can be further customized or new features can be added using Visual Studio Extensions.
Visual Studio 2019 has support for a huge list of programming languages and application frameworks. Applications ranging from the Mobile app, Windows app, Web App, Cloud Services, IoT apps, and many more can be built using this single IDE and the best of all the fully-featured Community Edition can be used without any license fee. [Download here]
1. Start Debugging: F5
The F5 shortcut starts the debugging of the application and may or may not invoke the following operations
- If there is any code change in the project after the previous build was generated, then first the build operation is triggered and then the debugging will start.
- If any breakpoint is applied before the application waits for any user input, then the application will break at that line of code.
2. Stop Debugging: Shift + F5
The Shift + F5 shortcut stops the current debugging session. The shortcut option is not available if the application is started in the “Start without Debugging” mode.
4. Restart Debugging: Ctrl + Shift + F5
The Ctrl + Shift + F5 shortcut restarts the debugging session. The shortcut stops the current session and starts a new one immediately. The shortcut option is not available if the application is started in the “Start without Debugging” mode.
5. Step Over: F10
The F10 shortcut can be used for two purposes, first and the most common use is to step over a line, the underlying line of code is executed and the debugger pointer moves to the next line.
The second use of the shortcut is to start the debugging session and breaks at the first line of code where the application starts, for example, the main method
6. Step Into: F11
If the current line of code under the debugger pointer contains any method, then pressing the F11 key will move the debugger pointer into the first line of the method. If the line contains no method in it, then the current line will be executed and the pointer will move to the next statement performing just like the “Step Over” function.
The other function of this shortcut is to start the debugging session and breaks at the first line of code where the application starts, for example, the main method
7. Step Out: Shift + F11
This shortcut will execute all the statements in the method where the debugger is currently present and return back to the line where the method is called.
8. Set Next Statement: Ctrl + Shift + F10
Many times while debugging it is required to skip certain lines of code or go back to the previously executed line and start executing from the selected line. This can be done by dragging the debugger pointer to that particular line or by using the placing the cursor to that line and using the Ctrl + Shift + F10 shortcut key. Therefore, the shortcut places the debugger point to the selected line of code.
9. Set and Toggle Breakpoint: F9
This shortcut comes really handy to toggle a breakpoint at the current line of code where the cursor is present.
10. Enable or Disable Breakpoint: Ctrl + F9
This shortcut is used to disable or enable a breakpoint.
Visual Studio 2019 is full of small great little features that help the user to perform his debugging activities in an easy and efficient way and the post discusses only a few of them. The complete list of Visual Studio 2019 shortcuts can be found at the MSDN link here.
I hope this post on Important Debugging Shortcuts of Visual Studio 2019 helpful, thanks for visiting, Cheers!!!
[Further Readings: How to publish a Blazor Server Application to IIS | Top 7 Visual Studio 2019 extensions for Web Projects | The difference in Blazor Server and WebAssembly Application | Exploring Blazor WebAssembly App Project Structure | Top 10 Productivity Tips and Tricks in Visual Studio 2019 | CRUD Operations in WPF using EntityFrameworkCore and SQLite | How to implement Dependency Injection in WPF | How to use External Tool in Visual Studio 2019 | Top Features of Visual Studio 2019 Community Edition | Basic CRUD operations in Blazor using SQLite as the database | How to consume REST API in Blazor Application | Blazor Lifecycle Methods ]