Resolved Having an issue with catching a serialization Exception

sock1992

Well-known member
Joined
May 20, 2020
Messages
107
Programming Experience
Beginner
When I run my program I get an exception unhandled notification for "System.Runtime,Serialization.SerializationException" however in my code I have caught this exception in a catch block. :/ Does anyone know why this is happening? I have caught many other exceptions and they all work as intended. Its only occurring with this particular exception.

When the exception stops the program, If I hit F10 it steps into the System.Runtime.Serialization.SerializationException catch block, which I thought was weird. That means I've entered the correct type of exception however its not being handled for some strange reason.

C#:
 try
            {
               
            catch (System.Runtime.Serialization.SerializationException) // i am catching the exception here
            {
                ExceptionHandling.RuntimeSerializationException();
            }
 
Last edited:
Post the full callstack. Are you sure the unhandled exception is coming from that try-catch?
 
When the exception stops the program, If I hit F10 it steps into the System.Runtime.Serialization.SerializationException catch block, which I thought was weird. That means I've entered the correct type of exception however its not being handled for some strange reason.
Actually the exception is being handled when the code executes the body of your catch statement. It sounds like you have VS configured to stop on all exceptions.
 
Back
Top Bottom