-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Serialization.MissingSerializableAttributeOnISerializableTypeRule(2.10)
Sebastien Pouliot edited this page Feb 9, 2011
·
3 revisions
Assembly: Gendarme.Rules.Serialization
Version: 2.10
This rule checks for types that implement System.ISerializable but are not decorated with the Serializable attribute. Implementing System.ISerializable is not enough to make a class serializable as this interface only gives you more control over the basic serialization process. In order for the runtime to know your type is serializable it must have the Serializable attribute.
Bad example:
// this type cannot be serialized by the runtime
public class Bad : ISerializable {
}
Good example:
[Serializable]
public class Good : ISerializable {
}
- This rule is available since Gendarme 2.0
Note that this page was autogenerated (3/17/2011 9:31:58 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!