NonSerializedAttribute
NonSerializedAttribute is a .NET attribute used to mark a field of a serializable class to be excluded from serialization when using the BinaryFormatter. It resides in the System namespace as NonSerializedAttribute and is used by applying the short form [NonSerialized] on a field inside a [Serializable] class. It targets fields and does not apply to properties.
During serialization with BinaryFormatter, any field marked with NonSerializedAttribute is not written to the serialized stream.
The attribute's effect is limited to BinaryFormatter-like serializers that honor it. Other serializers, such as DataContractSerializer,
Declaration: [AttributeUsage(AttributeTargets.Field, Inherited = false)] public sealed class NonSerializedAttribute : Attribute. The attribute's short name is NonSerialized.