Visual Studio Keyboard Shortcuts that Speed Up Debugging Applications | Mosh
Key Takeaways
This video covers essential Visual Studio keyboard shortcuts for debugging applications, including running applications with and without debug mode, setting breakpoints, and stepping through code.
Full Transcript
knowing how to use your keyboard when debuging an application is extremely important if you want to increase your productivity one of the things that I don't like about Visual Studio is this start button here on the toolbar I think it promotes the bad habit of using the mouse I've seen a lot of developers run the application using this button here and to make the matter worse they don't even know this way they run the application in the debug mode when you run the application in the debug mode Visual Studio loads extra information in the memory to provide you with the ability to debug the application this slows down your PC and affects your productivity you have to wait longer for the application to load and to respond to your actions often you just want to run the application to test your code not necessarily to debug then you shouldn't waste your time and your computer's Resources by going to the debug mode every time use the debug mode only when you're trying to fix a bug so how can we run the application without going to the debug mode you press contrl and F5 this will compile your application and launch it faster the application will also respond to your actions faster if you really need to go to the debug mode instead of pressing control and F5 press F5 only this is equivalent to pressing the start icon here on the toolbar so from now on if you ever need to debug the application make sure to use your keyboard to initiate the debugging session so let's repeat one more time because I want to make sure you really get this press contrl and F5 to run the application and press F5 to run the application in the debug mode okay now let's look at some more keyboard shortcuts that you need to know when debugging here in the main method I've created a new instance of the calculator class as you see there is a call to the add method with two arguments passed let's say this method is not working as we expect so we need to debug it we start by putting a breakpoint on this line when you insert a breakpoint and start the application in the debug mode the application code is executed until it reaches a breakpoint and then stops there to insert a breakpoint with the cursor on this line press F9 not this icon here that represents a breakpoint you can press f F9 again to remove the breakpoint now we run the application in the debug mode using F5 note that this line is highlighted we have two choices now we can step into the ad method and look exactly what's happening there or we can step over it and look at the result from a productivity point of view I recommend you to use a step over first and inspect the result if the result is not what you expect then you st step into a method to find out what's going on if you step into methods all the time you'll waste a lot of time verifying the code that may already be working so let's try this with the current line highlighted we press F10 that's the shortcut key for step over now we can inspect the result by hovering the mouse over this result variable here in this case it's okay to use your mouse to quickly inspect a few variables here and there as you see the value of the result is zero whereas I expected to be four so we need to step into the ad method to see what's going on there is just a tiny issue here the execution of code is always forward only you can't go back as you see the focus is currently on the console the right line method here so we can't go back and step into the ad method we need to stop the debugging session and start over to do this press control shift and F5 okay now we can step into the ad method to do this we press f11 so remember this to step over a method you press F10 and to step into it you press f11 these are your friends and you'll use them forever okay back to our debugging look where the execution now we can hover the mouse over these two arguments here to make sure they hold the right values as you see the input values are fine so there must be something wrong with the logic of this method note that it's returning zero instead of adding the two arguments together so let's go ahead and change the code now we press F10 to continue the ex execution and again and again and again okay now let's inspect the result variable it has the right value so let's review up to this point before I show you a few more techniques you use F5 to run the application in the debug mode you use F10 to step over a method and f11 to step into it now here is a good technique if you accidentally step into a method but your intention was to step over it you can always step out by pressing shift and F1 it's very easy to memorize this you press f11 to step into a method and shift an f11 to step out of it okay one more thing before we finish this lecture when you're in the debug mode it's possible to have multiple break points in different parts of the code that you would like to inspect if you press F4 five the execution continues until hitting the next break point sometimes you leave various break points here and there but you won't need them anymore then every time you start the debugging session those break points will get in the way and waste your time so make sure to remove them by pressing F9 if you no longer need them let's recap press contrl and F5 to run the application without debugging press F5 to run the application in the debug mode press shift and F5 to stop the debugging session press F9 to insert or remove a breakpoint press F10 to step over a method press f11 to step into it and finally press shift and F1 to step out of it I hope you enjoyed this lecture
Original Description
Get the COMPLETE COURSE: http://bit.ly/2IEk6Lo
My blog
http://www.programmingwithmosh.com/
Facebook
https://www.facebook.com/programmingw...
Twitter
https://twitter.com/moshhamedani
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Programming with Mosh · Programming with Mosh · 2 of 60
1
▶
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
6 Visual Studio Tips to Increase Your Productivity | Mosh
Programming with Mosh
Visual Studio Keyboard Shortcuts that Speed Up Debugging Applications | Mosh
Programming with Mosh
Backbone.js Tutorial Part 2 - Backbone.js Models: Working with Model Attributes
Programming with Mosh
Backbone.js Tutorial Part 3 - Backbone.js Models: Model Validation
Programming with Mosh
Backbone.js Tutorial Part 4 - Backbone.js Models: Model Inheritance
Programming with Mosh
Backbone.js Tutorial Part 1 - Backbone.js Models: Creating Models
Programming with Mosh
Backbone.js Tutorial Part 5 - Backbone.js Models: Syncing Models with the Server
Programming with Mosh
Backbone.js Tutorial Part 6 - Backbone.js Collections: Creating Collections
Programming with Mosh
Backbone.js Tutorial Part 7 - Backbone.js Collections: Working with Collections
Programming with Mosh
Backbone.js Tutorial Part 8 - Backbone.js Collections: Fetching Collections from the Server
Programming with Mosh
Backbone.js Tutorial Part 9 - Backbone.js Views: Creating Views
Programming with Mosh
Backbone.js Tutorial Part 10 - Backbone.js Views: Passing Data to Views
Programming with Mosh
Backbone.js Tutorial Part 11 - Backbone.js Views: Handling the DOM Events
Programming with Mosh
Backbone.js Tutorial Part 12 - Backbone.js Views: Handling the Model Events
Programming with Mosh
Backbone.js Tutorial Part 13 - Backbone.js Views: Handling Collection Events
Programming with Mosh
Backbone.js Tutorial Part 14 - Backbone.js Views: Templating
Programming with Mosh
Clean Code: Learn to write clean, maintainable and robust code
Programming with Mosh
C# Events and Delegates Made Simple | Mosh
Programming with Mosh
C# Generics Tutorial: Whats and Whys | Mosh
Programming with Mosh
Debugging C# Code in Visual Studio | Mosh
Programming with Mosh
Repository Pattern with C# and Entity Framework, Done Right | Mosh
Programming with Mosh
Angular 2 Tutorial for Beginners: Learn Angular 2 from Scratch | Mosh
Programming with Mosh
Architecture of Angular 2+ Apps
Programming with Mosh
Working with Components in Angular
Programming with Mosh
C# Tutorial For Beginners - Learn C# Basics in 1 Hour
Programming with Mosh
Difference between Junior and Senior Developers
Programming with Mosh
Step-by-step ASP.NET MVC Tutorial for Beginners | Mosh
Programming with Mosh
[Pluralsight]: Become a Full-stack .NET Developer
Programming with Mosh
Xamarin Forms Tutorial: Build Native Mobile Apps with C#
Programming with Mosh
Value Types and Reference Types in JavaScript
Programming with Mosh
Using Redux in Angular 2+ Apps | Mosh
Programming with Mosh
Testing Angular 2+ Apps with Jasmine and Karma | Mosh
Programming with Mosh
Profile and optimize your Angular 2 apps
Programming with Mosh
Build a Real-world App with ASP.NET Core and Angular 2
Programming with Mosh
Entity Framework 6 Tutorial: Learn Entity Framework 6 from Scratch
Programming with Mosh
Two-way Binding and ngModel in Angular 4
Programming with Mosh
Udemy Live 2017: Teaching Tech Panel
Programming with Mosh
Demo of An E-commerce App Built with Angular, Firebase and Bootstrap 4
Programming with Mosh
My Brand New Angular Course
Programming with Mosh
TypeScript Tutorial - TypeScript for React - Learn TypeScript
Programming with Mosh
Access Modifiers in TypeScript
Programming with Mosh
TypeScript Interfaces
Programming with Mosh
TypeScript Classes
Programming with Mosh
TypeScript Constructors
Programming with Mosh
TypeScript Properties
Programming with Mosh
Angular Tutorial for Beginners: Learn Angular & TypeScript
Programming with Mosh
AngularJS vs Angular 2 vs Angular 4 | Mosh
Programming with Mosh
Angular Material Tutorial | Mosh
Programming with Mosh
Angular Animations Tutorial | Mosh
Programming with Mosh
Firebase in Angular Applications | Mosh
Programming with Mosh
Deploying Angular Applications | Mosh
Programming with Mosh
Building Forms in Angular Apps | Mosh
Programming with Mosh
Directives in Angular Applications
Programming with Mosh
Routing and Navigation in Angular | Mosh
Programming with Mosh
Angular 4 in 40 Minutes
Programming with Mosh
[NEW COURSE] Unit Testing for C# Developers
Programming with Mosh
Unit Testing C# Code - Tutorial for Beginners
Programming with Mosh
C# Classes Tutorial | Mosh
Programming with Mosh
C# Object Initializers Tutorial
Programming with Mosh
C# Constructors Tutorial | Mosh
Programming with Mosh
More on: Systems Design Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
How I Structured My Next.js 14 App Router Project — And Why It Scales
Dev.to · Mbanefo Emmanuel Ifechukwu
The Hardest Part Of Microservices Is Undoing What Already Succeeded
Medium · Programming
What OOP Actually Buys You (And Why “Real World Modeling” Is a Lie)
Medium · Programming
Data Partitioning in System Design: Why Every Scalable Application Depends on It
Medium · Programming
🎓
Tutor Explanation
DeepCamp AI