SerializationException when serializing lots of objects in .NET

后端 未结 9 968
深忆病人
深忆病人 2020-12-10 01:41

I\'m running into problems serializing lots of objects in .NET. The object graph is pretty big with some of the new data sets being used, so I\'m getting:

Sy         


        
9条回答
  •  感动是毒
    2020-12-10 02:22

    I'm guessing... serialize less objects at a time?

    2 main questions:

    • what objects are they?
      • POCO?
      • DataTable?
    • what type of serialization is it?
      • xml?
        • XmlSerializer?
        • DataContractSerializer?
      • binary?
        • BinaryFormatter?
        • SoapFormatter?
      • other?
        • json?
        • bespoke?

    Serialization needs to have some consideration of what the data volume is; for example, some serialization frameworks support streaming of both the objects and the serialized data, rather than relying on a complete object graph or temporary storage.

    Another option is to serialize homogeneous sets of data rather than full graphs - i.e. serialize all the "customers" separately the "orders"; this would usually reduce volumes, at the expense of having more complexity.

    So: what is the scenario here?

提交回复
热议问题