[xmlIgnore]

  • Thread starter Romain TAILLANDIER
  • Start date
R

Romain TAILLANDIER

hi group

throw the XmlSerializer class, public properties/variable are code to xml,
and private aren't.
i can put an [XmlIgnore] attribut to force the serializer to not serialise a
public member, but how can i do to force the serializer to take care about a
private member ?

clearly what's the opposite of [XmlIgnore] ?

I try to dynamically put the attribute to XmlIgnore(false) or something like
that, but don't seems to work.

thanks for any help :)
ROM
 
T

Teemu Keiski

Hi,

see:
http://msdn.microsoft.com/library/d...ide/html/cpconintroducingxmlserialization.asp

Note the text:
"
Note XML serialization does not convert methods, indexers, private
fields, or read-only properties (except read-only collections). To serialize
all an object's fields and properties, both public and private, use the
BinaryFormatter instead of XML serialization.
"

In addition to this, you can use SoapFormatter to serialize the object to
SOAP format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top