Quando scrivo codice come questoNonSerialized sulla proprietà
[XmlIgnore]
[NonSerialized]
public List<string> paramFiles { get; set; }
ottengo il seguente errore:
Attribute 'NonSerialized' is not valid on this declaration type.
It is only valid on 'field' declarations.
Se scrivo
[field: NonSerialized]
ottengo il seguente avviso
'field' is not a valid attribute location for this declaration.
Valid attribute locations for this declaration are 'property'.
All attributes in this block will be ignored.
Se scrivo
[property: NonSerialized]
ho il seguente errore (di nuovo):
Attribute 'NonSerialized' is not valid on this declaration type.
It is only valid on 'field' declarations.
Come posso usare [NonSerialized]
su una proprietà?
Possibile duplicato di [Come contrassegnare una proprietà come non serializzabile per json?] (Http://stackoverflow.com/questions/5103200/how-to-mark-a-property-as-non-serializable-for- json) –