Exceptions Frequently Asked Questions

How can I resolve the "Unknown class '' found in stream" exception, occurring when a complex type is deserialized in Silverlight or the .NET Compact Framework?

Due to limitations of the .NET Compact Framework, you have to manually register the assembly containing your complex type definitions using code like this:


You need to use similar code in both Silverlight and the .NET Compact Framework client applications.

Why is a "Could not load type" exception raised when GetCustomAttributes is called?

This could be caused by custom class attributes referencing some obfuscated classes.

Add the attribute

[System.Reflection.ObfuscationAttribute(Exclude := true, ApplyToMembers := false)]

to the declaration of classes referenced by the custom attributes to avoid it.