Home

Cannot prevent debugger breaks when running try / catch.

I have a very simple bit of code within void Main() { ... } that I'm using to test try / catch functionality.

try
{
    Console.WriteLine(1/0);
}
catch (Exception e)
{
    Console.WriteLine(e);
}

No matter what, the debugger breaks at the divide by zero rather than allowing the catch to do its thing. I've tried toggling both the "bug" icons on the query toolbar that are supposedly break options - to no avail.

There's a "Start without debugging" option in the debug dropdown menu, but it's always greyed out.

Any ideas? Linqpad 7, premium edition. Thank you!

Comments

Sign In or Register to comment.