I am unable to move the next statement pointer in VS2022 outside the catch block if an Exception is thrown.
If I run this code in a VS2022 (17.14.4) Unit Test Project (.Net 4.81), set a break point on the catch statement and as soon the breakpoint is hit, try to move the next statement back to one line within the try block I get an error window with the message: <<Unable to set the next statement. The attempt to unwind the callstack failed. ....>>
If I do the same in a VS2019 (16.11.47) Unit Test Project I can move the next statement pointer wherever I want. I compared the settings in both environments and did not find differences in Options or Exception Settings.
I encounter this problem even if I open the same Project from both version of Visual Studio, or if I create a plain vanilla Unit Test project for both versions.
[TestMethod]
public void TestMethod1()
{
try
{
if (1 != 0) throw new Exception("Not equal!");
}
catch
{
throw;
}
}
What do I have to change to get the same behaviour as in VS2019?