It′s not supported for auto implemented properties. You have to use a backing field and set the NonSerializedAttribute on it.
public class ClassWithNonSerializedProperty {
[NonSerialized]
private object _data; // Backing field of Property Data that is not serialized
public object Data{
get { return _data; }
set { _data = value; }
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…