如何使无.NET序列化attibute一类可序列化 [英] How to make a class serializable without Serializable attibute in .net
问题描述
我有一个调试器可视化的看到数据表的形式类对象的列表。但是,限制为code是这个类是可序列化,即应被标记为[Serializable接口]如果该类没有标记序列化,然后调试器崩溃。所以,有谁能够告诉我如何使一个类可序列化在运行时,如果该类没有标记序列化。
I have one debugger visualizer for seeing list of class object in the form of data table. But the limitation for the code is that the class should be serializable i.e. should be marked as [Serializable] and if the class is not marked Serializable then the debugger crashes. So, can anybody tell me how to make a class Serializable at run time if the class is not marked Serializable.
谢谢 Ashwani
Thanks Ashwani
推荐答案
如果一个类没有标记 [Serializable接口]
,您可以使用的 SerializationSurrogate
If a class is not marked [Serializable]
, you can try serialization using SerializationSurrogate
这篇关于如何使无.NET序列化attibute一类可序列化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!