我一直试图序列化一个非常大的对象。 该对象使用字典来跟踪各种数据。 我正在使用二进制格式化程序,并且希望能够轻松地序列化整个对象,而不会干扰/不得不在下面的层中更改代码。
有没有办法解决这个问题? 我不想手动序列化字典(正如我见过别人那样解决这个问题)。
解决这个问题的人得到了金盘;)
I have been trying to serialize a pretty big object. This object uses dictionaries in order to keep track of various data. I am using the binary formatter, and want to be able to easily serialize the whole object whithout interfering/having to change code in the below layers.
Is there any way fix to this? I don't want to serialize the dictionaries manually (as I've seen others do to solve this issue).
The one who solves this get the golden plate ;)
最满意答案
如Anton所述,二进制序列化程序能够序列化对象图中的所有对象,只要图中的每个对象都是可序列化的。 如果您在诊断对象图中的哪些对象不可序列化时遇到问题,可以使用sertool查找:
As stated by Anton, the binary serializer is capable of serializing all objects in your object graph, as long as each object in the graph is serializable. If you're having trouble diagnosing which objects in your object graph aren't serializable, you can use sertool to find this out:
更多推荐
发布评论