Bugzilla – Bug 693306
Failed to serialize private fields of base data contract.
Last modified: 2011-05-12 07:39:39 UTC
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) DataContractSerializer doesn't serialize private fields of all base data contracts. But public fields are serialized successfully. Additional information is described in the following MSDN article: http://msdn.microsoft.com/en-us/library/ms733127.aspx. Citation: "Member accessibility levels (internal, private, protected, or public) do not affect the data contract in any way". Reproducible: Always Steps to Reproduce: 1. Declare a new data contract named 'A' with private read-only field 'fa'; 2. Derive another data contract 'B' from 'A'. 3. Create a new instance of 'B'; 4. Serialize instance of 'B' with DataContractSerializer. Actual Results: Normal serialization/deserialization. Expected Results: Serialization/deserialization of public fields and fields declared at the top of data contract hierarchy.
Correction: this issue is actual for JSON serialization/deserialization only(through DataContractJsonSerializer).