13

I have a method which I am interested to see it’s functionality and dig deeper into it; so I put a breakpoint and I stepped into the method.

This method executes a foreach loop along the way and this foreach keeps iterating many times. I am not interested in seeing the iteration going on in this foreach loop.

Is there a way in Visual Studio to ”step out of this loop” and continue debugging?

2
  • 2
    Good question - I usually just put a break in the next line after the loop and press F5, then remove the breakpoint :-) Commented Feb 18, 2016 at 16:06
  • In VS2013, you can just drag and drop the cursor. But that way, the foreach will not all be executed. Commented Feb 18, 2016 at 16:11

3 Answers 3

21

Right-click on a line after the loop, then click Run to cursor.

Sign up to request clarification or add additional context in comments.

1 Comment

Huh... I never knew there was an option for this... Very useful for not needed to put one-off temporary breakpoints in.
8

While debugging, put a breakpoint just after your loop and press F5.

Comments

5

While debugging, right click on the source code line after the loop and from the context menu select "Run to Cursor".

Alternatively set the cursor to the line after the loop by left-clicking and press Ctrl+F10 on the keyboard to trigger the "Run to Cursor" command.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.