Cuando escribo código como esteNonSerialized en la propiedad
[XmlIgnore]
[NonSerialized]
public List<string> paramFiles { get; set; }
me sale el siguiente error:
Attribute 'NonSerialized' is not valid on this declaration type.
It is only valid on 'field' declarations.
Si escribo
[field: NonSerialized]
me sale el siguiente aviso
'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.
Si escribo
[property: NonSerialized]
me sale el siguiente error (de nuevo):
Attribute 'NonSerialized' is not valid on this declaration type.
It is only valid on 'field' declarations.
¿Cómo puedo usar [NonSerialized]
en una propiedad?
Posible duplicado de [¿Cómo marcar una propiedad como no serializable para json?] (Http://stackoverflow.com/questions/5103200/how-to-mark-a-property-as-non-serializable-for- json) –