It's better to provide more information in the error message include how to turn on circular reference, which is common EF CF case.
Different serializer has different settings for circular reference.
For json.net, it's good to use [JsonObject(IsReference = true)] to preserve the reference.
For DataContractXmlSerializer and DataContractJsonSerializer, it's suggested to use [DataContract(IsReference=true)] to preserve the reference.
It seems that XmlSerializer has no support on preserving reference.
Comments: Attach repro project.
Different serializer has different settings for circular reference.
For json.net, it's good to use [JsonObject(IsReference = true)] to preserve the reference.
For DataContractXmlSerializer and DataContractJsonSerializer, it's suggested to use [DataContract(IsReference=true)] to preserve the reference.
It seems that XmlSerializer has no support on preserving reference.
Comments: Attach repro project.