Why are fields not serializable via the XML serializer, in C#, whereas properties are? I know that properties are actually methods, but I don't see why that should make a difference. Does anyone know the answer to this?
Thanks so much!
Fields are serializable :
XML serialization serializes the public fields and properties of an object, or the parameters and return values of methods, into an XML stream that conforms to a specific XML Schema definition language (XSD) document. XML serialization results in strongly typed classes with public properties and fields that are converted to XML. System.Xml.Serialization contains the classes necessary for serializing and deserializing XML.
From MSDN