Suzanne Cook's .NET CLR NotesCommon Language Runtime DeveloperDebugging an InvalidCastException- June 3, 2004 First, obviously, find the two types for which the cast failed and verify that they are the same type or otherwise castable. Next, if the type was just deserialized, also verify that its assembly successfully loaded in the target appdomain. If everything seems fine, check to see if the assemblies for those two types are loaded from different locations and in the same appdomain. (The actual cast is done in just one appdomain, even if the exception happens when...http://blogs.msdn.com/suzcook/archive/2004/06/02/debugging-an-invalidcastexception.aspx |