While using this code to serialize an object:
public object Clone() { var serializer = new DataContractSerializer(GetType()); using (var ms = new Sys
Either annotate your classes with [DataContract] or add your child types in the constructor of DatacontractSerializer.
[DataContract]
var knownTypes = new List {typeof(Class1), typeof(Class2), ..etc..}; var serializer = new DataContractSerializer(GetType(), knownTypes);