- Home /
Limit reached when serializating XML
I've been working in a game that uploads player's data to my server every X seconds. I'm using the XML serialization from the wiki http://wiki.unity3d.com/index.php?title=Save_and_Load_from_XML But after uploaded 50 times, it send the following error
InvalidCastException: Cannot cast from source type to destination type.
Mono.GeneratedSerializers.Literal.GeneratedWriter.WriteRoot_UserData (System.Object o)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as InvalidOperationException: There was an error generating the XML document.
System.Xml.Serialization.XmlSerializer.Serialize (System.Xml.XmlWriter writer, System.Object o, System.Xml.Serialization.XmlSerializerNamespaces namespaces)
System.Xml.Serialization.XmlSerializer.Serialize (System.Xml.XmlWriter xmlWriter, System.Object o)
XMLS.SerializeObject (System.Xml.XmlDocument pObject) (at Assets/Plugins/XMLS.js:70)
I tried by cleaning memory stream and by changing my code but nothing works.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613092131im_/https://answers.unity.com/themes/thub/images/avi.jpg)