C#C
C#3y ago
Pillow

System.InvalidOperationException: ... cannot be serialized because it does not have a parameterles..

I'm trying to make an AOT class library, but I am unable to run it once compiled.

Here's the bit of code it doesn't like
var parser = new TMXParser();
parser.Export(tmx, tmxpath);
and the full error:
Unhandled Exception: System.InvalidOperationException: There was an error generating the XML document.
 ---> System.InvalidOperationException: TMXTile.TMXMap cannot be serialized because it does not have a parameterless constructor.
   at System.Xml.Serialization.TypeDesc.CheckSupported() + 0x44
   at System.Xml.Serialization.TypeScope.GetTypeDesc(Type, MemberInfo, Boolean, Boolean) + 0xa5
   at System.Xml.Serialization.ModelScope.GetTypeModel(Type, Boolean) + 0x5a
   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type, XmlRootAttribute, String) + 0x50
   at System.Xml.Serialization.XmlSerializer.GetMapping() + 0x4f
   at System.Xml.Serialization.XmlSerializer.SerializeUsingReflection(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) + 0x1a
   at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) + 0x84
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) + 0x1a8
   at TMXTile.TMXParser.Export(TMXMap, Stream, DataEncodingType) + 0x97
   at TMXTile.TMXParser.Export(TMXMap, String, DataEncodingType) + 0x73
   at ToasterMap.ToasterMap.Init(IntPtr, IntPtr) + 0xef
Was this page helpful?