Prevents a field or property from being serialized.
[nonserialized]
Field and property declarations.
nonserialized is a single-use attribute. nonserialized is an alias for System.Serialization.NonSerializedAttribute.
If a class has the serializable attribute, the base class library serialization services will, by default, serialize all the fields and properties of the class. In some cases, a field or property should not be serialized, either for performance or correctness reasons (for example, it does not make sense to serialize a file handle). The nonserialized attribute placed on a field or property prevents it from being serialized.
See the example for the serializable attribute.