Vb.net标记serializable()使用或不使用mark? [英] Vb.net mark serializable() use or not use mark?

查看:240
本文介绍了Vb.net标记serializable()使用或不使用mark?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我想知道警告CA2237: Mark Iserializable

有没有人知道为什么它是一个警告,为什么我应该用标签

< serializable()>  

这只对情报有用还是提供任何功能?



我尝试了什么:



了解以下文章基本序列化使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆