After some time of searching I stumbled also over your question.
Yes, the accepted answer is a workaround for your problem -> you can go to Debug>Windows>Exception Setting and choose "System.InvalidOperationException" as described in the answer above.
However, this will then break always any "System.InvalidOperationException" even if the exception is handled in a try and catch block.
Alternatively, I suggest you open the "Call Stack window" (Debug > Windows > Call stack).
Here (not sure if this is a new feature in Visual Studio 2022 because in Visual Studio 2019 I don't have this problem) you will see two nearly identical call stacks:
- One starting with [Exception] like "[Exception] ... call stack data ..."
- and another identical but without [Exception] like "... call stack data ..."
If you double click on the second one your local variables are filled - while in the first one with [Exception] your local variables are not filled (which is the default one in case of an exception.
Indirectly this behavior is also described in your error message:
Local variables and arguments are not available in '[Exception]' call stack frames.
Unfortunately, I've no idea why Visual Studio 2022 now creates two similar call stacks in case of an exception while Visual Studio 2019 doesn't.