Vb.net标记serializable()使用或不使用mark? [英] Vb.net mark serializable() use or not use mark?
问题描述
亲爱的朋友们,
我想知道警告CA2237: Mark Iserializable
有没有人知道为什么它是一个警告,为什么我应该用标签
< serializable()> $ p $标记它p>
这只对情报有用还是提供任何功能?
我尝试了什么:
了解以下文章基本序列化和使用SerializableAttribute标记ISerializable类型解决方案
再次尝试阅读链接。你的第二个链接提供了相当清楚的答案:
要被公共语言运行时识别为可序列化,必须使用SerializableAttribute属性标记类型,即使该类型通过实现ISerializable接口使用自定义序列化例程。
Dear Friends,
I am wondering about warning CA2237: Mark Iserializable
Does anyone know why it is a warning and why I should mark it with the tag<serializable()>
Is this only usefull for the intelligence or does it provide any functionality?
What I have tried:
Readed the following articles Basic Serialization and Mark ISerializable types with SerializableAttribute解决方案Try reading the links again. Your second link provides the answer quite clearly:
To be recognized by the common language runtime as serializable, types must be marked with the SerializableAttribute attribute even if the type uses a custom serialization routine through implementation of the ISerializable interface.
这篇关于Vb.net标记serializable()使用或不使用mark?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!