0
kicks
XML serialization does not support circular references
On a .NET 2.0 project I’m currently working on, where I’m getting my data from a webservice, I was getting the following error:
System.InvalidOperationException: Er is een fout opgetreden bij het genereren van het XML-document. ---> System.InvalidOperationException: Er is een kringverwijzing aangetroffen tijdens het toepassen van serialisatie op een object van het type BusinessObjects.Domein.
In English the error was:
System.InvalidOperationException: A circular reference was detected while serializing an object of type BusinessObjects.Domein.
I’ve found out that one of my objects must hold onto another object that is higher up in the chain which resulted into a circular reference. Yes indeed, this is true, but now it seems that xml serialization can’t handle it. My business object has a logical parent-child tree structure and that’s exactly how I want to have my business objects.