r/programminghelp • • Feb 17 '20

C# C# XML Serialization help

I'm using XML Serialization to read XML into classes in C#. But there's this one particular error:

Every time I use CloneObjectSerializable() on an instance it gives me this error:

Type 'System.Xml.XmlNode' in Assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable

Even though I marked every class with

[System.SerializableAttribute()]

with the correct

XMLRoot()

too. Basically the mapping with the structure of the XML is correct, if I switch to debug mode all the data that the classes have after reading XML are correct too, yet I just can't seem to clone an object generated by XML. What is going on ? I feel like I'm losing my mind :(

3 Upvotes

0 comments sorted by