From the course: Visual Studio Essential Training

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Valid breakpoint locations

Valid breakpoint locations

- [Instructor] In this video, we'll be looking at the code in this other button handler, this BreakButton_Click event handler. Some of the code that's in here is declaring some numeric variables and doing some calculations. One caveat of using break points is that you cannot put a break point on a line of code that is not going to execute. So for example, line 42 is a comment that's not executable. If I press F9 or go over here and click on the gray border, nothing's happening. Well, something's happening, but it's not as obvious. Look in the lower left, there's a message that says a break point could not be inserted at this location. So I can't put one here on the comments. I also can't put a breakpoint here on line 39 where I'm declaring this variable. There's no code executing there. However, on line 40, I can put one and the same on line 41. What about the method declare? If I try to put a break point on line 36, Visual Studio puts the break point on the first curly brace that's…

Contents