« Home | Generic List Covariance » | Dell 2405FPW » | VS2005 Release » | Useful Sparkle/XAML Links » | Dead Computer Talking » | Feature Estimation » | OnTime Setup Notes » | OnTime » | Computer Zen Guestmap » | Delayed RSS/feeds »

SoapSerializer and Generics Don't Mix

After a bunch of monotonous code changes the previously V1.1 application now compiles successfully under V2.0 of .NET with generics in used for all domain model aggregation relationships. One of the first problems arose at runtime was the following exception:

“Soap Serializer does not support serializing Generic Types”

A Soap serializer was chosen originally since it was an (arguably) human readable format and worked with any serializable classes without much effort. Being a lazy programmer I chose the Soap serializer route rather than the XmlSerializer because of the extra effort needed for non public members and more complex classes. The solution to the problem was just to use an ArrayList for the property in question, which fortunately didn’t have too many flow on effects. Still its a shame not to have both a binary and a text based serialization format that serializer/deserialize an arbitrary Serializable class including support for generics.

Links to this post

Create a Link