Home > Back-end >  VS2022 - Can't view values of variables when exception thrown - Local variables and arguments a
VS2022 - Can't view values of variables when exception thrown - Local variables and arguments a

Time:09-23

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.

CodePudding user response:

I just had this issue out of the blue and can confirm that @jingmiao-xu-msft is correct - going to Debug -> Windows -> Exception Settings had only a handful of checks against Common Language Runtime Exceptions.

I have highlighted all of them and now have access to variables in the watch lists again.

CodePudding user response:

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

  • Related