views:

69

answers:

1

Is there a way to avoid Visual Studio from going to another file when pausing a session?

If you’re debugging a class somewhere else and the code is called from a form which in turns executes a ShowDialog(); (or similar), if you suddenly pause the application, Visual Studio will switch to the file (which sometimes is the Main() method). I’d like to stay in the file I have in front of me, since I usually need to add/remove waypoints or change code and it’s annoying (if you have too many open files) to go back to the point where i was before the pause.

Couldn’t find the option.

+1  A: 

I'm not sure exactly how to solve your problem, but perhaps you may want to use one of the following methods for easily returning to the exact point you were interested in:

A. (From the Menu) View -> Navigate Backward. I have this bound to a key combination I find easy. Note that this only works positions in the code where you have actually been editing / navigating with the cursor.

B. Add a bookmark to the line you're interested in returning to with the key combination Ctrl-K, Ctrl-K. You can view, name, and navigate to all your bookmarks via the bookmark window. You can also navigate through your bookmarks via the key combination Ctrl-K, Ctrl-N

Daniel Robinson
Thanks Daniel, that’s what I do more or less, but I was hoping there was a way to avoid VS going to the current location.
Martín Marconcini