Calling ToString on derived exception object

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
I have a serialized object derived from System.Exception.
When I call ToString() on it, it is returning object.ToString.
Exception ex = appContext.ApplicationException;<br/>
System.Diagnostics.Debug.WriteLine(ex.ToString());
ILDASM confirmed this:
IL_00f3: callvirt instance string [mscorlib]System.Object::ToString()<br/>
IL_00f8: call void [System]System.Diagnostics.Debug::WriteLine(string)
Why am I not getting the default Exception.ToString? (class appContext and my custom exception were both serialized at one point if that matters...)

View the full article
 
Back
Top