How to find a circular link during XML serialization?

I am trying to debug XML serialization. During xml serialization, the serializer "detected a circular reference". I would like to find him and get rid of him. Is there a convenient tool / approach that I can use?

+5
source share
2 answers

This is usually pretty obvious with a manual inspection ...

You can try to serialize the file and just look at the end of the file - it will not be full XML, obviously, but it should give the key.

, DataContractSerializer ( ) , XML, XmlSerializer, XML; , , . - :

[XmlIgnore]
public Person Parent {get;set;}

(.. "" )

+2
$normalizers->setCircularReferenceHandler(function ($object) {
    return $object->getId();
});
0

All Articles