Find source of Exception shown in VS output window

What can I do to find out which part of my code throws this exception or where it happens. Is there a way to show/visualize this in VS? Debugger options?

In Visual Studio, choose Debug then Exceptions.

In the Exceptions window, tick Thrown on the Common Language Runtime Exceptions row.

Click OK.

Now whenever an exception is thrown, the debugger will break on the offending line. You can also expand the selection to only include the exceptions of interest.

Visual Studio 2017

You can find this under Debug.Windows.Exception Settings


Comments

  1. Beckett

    • 2020/8/5

    What can I do to find out which part of my code throws this exception or where it happens. Is there a way to show/visualize this in VS?

  2. Mac

    • 2016/11/28

    In Visual Studio, choose Debug then Exceptions. In the Exceptions window, tick Thrown on the Common Language Runtime Exceptions row. Click OK. Now whenever an exception is thrown, the debugger will break on the offending line. You can also expand the selection to only include the exceptions of interest.

  3. Kye

    • 2016/10/26

    Your exception handling is working properly. From my tests, it looks like the Debug Output window in Visual Studio always shows the 

  4. Alvarez

    • 2015/3/12

    You can also add or delete exceptions. With a solution open in Visual Studio, use Debug > Windows > Exception Settings to open the Exception Settings window. Provide handlers that respond to the most important exceptions. If you need to know how to add handlers for exceptions, see Fix bugs by writing better C# code.

  5. Andres

    • 2017/8/13

    With a solution open in Visual Studio, use Debug > Windows > Exception the debugger writes an exception message to the Output window.

  6. Pablo

    • 2018/5/1

    The Visual Studio IDE changes while your app is running: the Output window is replaced by two new ones (in the default window configuration), the Autos/Locals/Watch tabbed window and the Call Stack/Breakpoints/Exception Settings/Output tabbed window. These windows have multiple tabs that allow you to inspect and evaluate your app's variables

  7. Benedetti

    • 2021/7/27

    that Visual Studio provides to help you debug exceptions, A non-modal Exception helper will appear near the exception icon.

  8. Kalel

    • 2018/4/5

    Current Project: Show errors, warnings, and messages from the project of the currently selected document in the Editor or the selected project in Solution Explorer. Note The filtered list of errors, warnings, and messages will change if the project of the currently selected document is different from the project selected in Solution Explorer .

  9. Vihaan

    • 2016/3/19

    Find source of Exception shown in VS output window [duplicate]. When running my application in VS2013 I get the exceptions: A first chance exception of type 

  10. Robert

    • 2018/5/17

    View the source code for a function on the call stack. In the Call Stack window, right-click the function whose source code you want to see and select Go To Source Code. Run to a specific function from the Call Stack window. In the Call Stack window, select the function, right-click, and then choose Run to Cursor.

  11. Di Stefano

    • 2020/12/30

    vs.debug.options.General. VS.ToolsOptionsPages.Debugger.General. VS. that would ordinarily appear in the Output window to the Immediate window instead.

  12. Jorge

    • 2017/3/25

    The Output window is a veteran in the war against bugs and has been part of Visual Studio since its very first release. It is comprised of a collection of text panes that communicate information to the user: The Output window can be extended by adding to its collection of text panes programmatically,

  13. Hysi

    • 2017/11/12

    To run or debug a simple app in VS Code, select Run and Debug on the Debug start view the DEBUG CONSOLE panel is displayed and shows debugging output, 

  14. Parker

    • 2018/11/8

    Variable values shown in hovers or inlined in the source. Managing watch expressions. Debug console for interactive evaluation with autocomplete.

  15. Jeremias

    • 2018/8/20

    However Rider does not seem to show exceptions in 'Debug output' (or any other window) and therefore requires that you must enable 'Any 

Comments are closed.

Recent Posts