3

Newbie here. I don’t know how it happened but I am working on a program and when I went to debug and step into, the yellow arrow went to the very end of my code and skipped the whole block. Is there a quick fix for this?

cocoa
  • 3,806
  • 7
  • 29
  • 56

2 Answers2

1

Hit F11, or click on the "Step Into" button on the toolbar.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
Gjeltema
  • 4,122
  • 2
  • 24
  • 31
  • I’ve been able to step into in the past by doing that. When I click on that it just skips over the whole code. – cocoa Apr 28 '13 at 03:18
  • What is it you're trying to step into? Is it giving you a dialog saying something like "auto skipping over this code"? – Gjeltema Apr 28 '13 at 03:22
  • I’m just trying to step into the whole program in general. I would like to do one method perhaps. I don’t get any errors – cocoa Apr 28 '13 at 03:24
  • Have you set a breakpoint? (A red dot on the left side of the line of code)? – Gjeltema Apr 28 '13 at 03:26
  • Look at the link in my answer, maybe that helps. Skim through the settings of the debugger. – Csaba Toth Apr 28 '13 at 03:35
  • I thought I tried that already but I just tried it now and it works. Thanks! – cocoa Apr 28 '13 at 03:36
1

Sometimes when you debug loops, iterations or lambda functions and delegates, the "yellow arrow" jumps for one step to the end of the scope block. You can keep hitting F11 more consecutive times, until it jumps back to the beginning statement (iteration criteria, delegate signature, lambda expression), and finally goes into the inner block.

What often also happens (as I mention lambda functions and delegates), that in case of invocation of those such layers of calls happen on the call stack which are part of the .NET system, and unless you configure Visual Studio carefully, you won't be able to debug into those. In that case place a breakpoint into the lambda function/delegate's body and press F5, and you should hit the breakpoint. But in such case the system warns you with a message, that it cannot display source code, you can see only assembly.

Also take a look at your Debugger settings: link

Community
  • 1
  • 1
Csaba Toth
  • 10,021
  • 5
  • 75
  • 121