Search code examples
c#exceptionvisual-studio-debuggingvisual-studio-2022

VS2022 - Can't view values of variables when exception thrown - Local variables and arguments are not available in '[Exception]' call stack frames


I'm getting an InvalidOperationException thrown (which should be easy to fix). However when the exception is thrown, I can't view any of the current values in the Locals debug window. They all have the same message:

Local variables and arguments are not available in '[Exception]' call stack frames. To obtain these, configure the debugger to stop when the exception is thrown and rerun the scenario.

Not sure why this is happening (maybe something to do with async?) but this is relatively simple code and I should be able to see the value of these variables.


Solution

  • You can go to Debug>Windows>Exception Setting and choose "System.InvalidOperationException" to solve the issue. enter image description here