Search code examples
c#visual-studiounhandled-exception

How to see details (e.g. inner exception) of unhanded exception


In visual studio if exception is unhanded and studio cannot find source code that caused it, screen like this will be shown:

enter image description here

And that's ok. Let's say I don't need the code, but how can I at least see some exception info except type and message? Inner exception would be helpful for example.

Edit: As suggested in @victor-alexandru-papa's answer if "Break when thrown" for Common Language Runtime Exceptions is checked, it will indeed show more info about exception. (in my case break mode was caused by exception in not awaited task).

Wanted to do this edit to add some screenshots of what happens. So, as you can see, new View details button appears, which actually shows details of the exception. Also I can see stack now and state of my application when exception was thrown.

enter image description here


Solution

  • You could try going to Debug, Windows, Exception Settings, and check the box under "Break when thrown" for Common Language Runtime Exceptions.