How to jump back to the line of code that threw exception in Visual Studio 2010 debugger?

前端 未结 3 2030
孤街浪徒
孤街浪徒 2021-02-19 17:33

Using the Visual Studio 2010 debugger, I am familiar with using the Call Stack window to see where the currently executing function was invoked from.

I\'m working with s

相关标签:
3条回答
  • 2021-02-19 17:57

    For Visual Studio 2019:

    Go to Debug -> Windows -> Exception Settings and mark every exception under Common Language Runtime Exceptions.

    0 讨论(0)
  • A solution might be to make VS break on all exceptions:

    Select Exceptions under the Debug menu, and check the "Thrown" box related to Common Language Runtime Exceptions.

    Now VS should now stop and mark the line where the exception is thrown. You can continue as usual, by clicking the play button or F5.

    The downside of this is that all exceptions will be caught in the same way, which may be annoying if you have a lot of them.

    0 讨论(0)
  • 2021-02-19 18:14

    If you goto "DEBUG", "Exceptions..." and then select "Thrown" against "Common Language Runtime Exceptions".

    Exceptions

    Then when your code encounters an exception it will stop on the line with the error.

    0 讨论(0)
提交回复
热议问题