[RESOLVED] XML serialization, hide some properties.
Hi,
I am XML-serializing my classes. But when the serialization takes place; all public properties are in the resulting XML-file. But there are certain properties that I do not want to be exported.
Is there a keyword or way to avoid the serialization of specific properties?
I tried several articles and tutorials, and even the Microsoft MSDN-library, but I did not find it anywhere.
Thank you in advance.
Re: XML serialization, hide some properties.
Mark them with the NonSerialized attribute...
eg:
VB Code:
<NonSerialized()> Public MyString As String
For a property, try using the XmlIgnore attribute::
VB Code:
<Xml.Serialization.XmlIgnore()> Public Property MyProperty() As Integer
Get
Return Me._int
End Get
Set(ByVal Value As Integer)
Me._int = Value
End Set
End Property