Interviews2 answers
Why not private variables serialized with xmlserializer?
2 Answers
XMLSerializer is introduced in .NET 1.0 and specially designed for working with ASMX services.
As per the design, it requires to serialize only public properties.
Also, XMLSerializer depends on the serialization assembly generated during run-time. XMLSerializer uses this runtime-generated assembly to serialize types. Doesn't use reflection. Hence, private variables are not serialized.
Murali PoolaPosted May 23, 2012, 12:50 AM EDT
You cannot serialize private members using XmlSerializer unless your class implements the interface IXmlSerializable.
AnithaPosted Apr 30, 2012, 4:24 AM EDT
