SebA
SebA

Reputation: 133

C# Try/Catch doesn't catch exception

I got an issue with a try catch block. It doesn't catch the exception of the code in the try block. Does anybody already had an issue like that and know how to solve it. The variable myCon is a MySqlConnection. The Exception occurs when the wait_timeout of the session is exceeded. Restarting, Rebuilt, change of CPU settings already tried.

enter image description here

P.S. When I press F10/F5 it doesn't jump into the catch block

Upvotes: 0

Views: 343

Answers (2)

Anganthier
Anganthier

Reputation: 126

I am not sure, but I can't see that Ping() is actually letting exceptions pass through. It just returns true or false.

For example the Open() method actually might throw an exception of type MySqlException, but not Ping()

Upvotes: 2

Marcus Kiønig
Marcus Kiønig

Reputation: 11

It probably is the debug point made by Jon Skeet and Steven Wood, if not, have you tried removing HandleProcessCorruptedStateExceptions?

Upvotes: 0

Related Questions