View Single Post
  #2 (permalink)  
Old June 6th, 2013, 04:12 PM
Rod Stephens's Avatar
Rod Stephens Rod Stephens is offline
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts

Hi John,

I'm sorry this didn't work as expected and that it sometimes seems inconsistent.

I don't know why you would need to press Enter. My system doesn't do that.

The bottom line is, when the program is stopped you can hover over variables to learn their values. Depending on the line where you set the breakpoint, all I can figure is the program is stopping in slightly different ways.

For example, if you set a breakpoint on a variable assignment (like x = 10), then it should stop before executing that line.

If you try to set a breakpoint on the declaration for a method, it probably sets the breakpoint on the "{" after the declaration.

Sometimes you may need to press F10 to step over a line of code before you can work with the variables in that line.

Visual Studio won't let you set breakpoints on some statements such as comments because the compiler actually strips them out before running the program because they don't really mean anything to the program, just to you.

The Locals, Autos, and other windows may not appear automatically so you may need to display them yourself when you want them. If they're missing and you want them, look in the Debug menu's Windows submenu. (I usually hide those windows and just hover over variables to see their values.)

Unfortunately I can't tell exactly what you'll see in your installation because Visual Studio is highly configurable so your installation may not look quite like mine or anyone else's.

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)