Bug 693306 - Failed to serialize private fields of base data contract.
Summary: Failed to serialize private fields of base data contract.
Status: NEW
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: WCF (show other bugs)
Version: 2.10.x
Hardware: x86 Ubuntu
: P5 - None : Major
Target Milestone: ---
Assignee: Atsushi Enomoto
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 06:55 UTC by Roman Sakno
Modified: 2011-05-12 07:39 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Sakno 2011-05-12 06:55:43 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.
Comment 1 Roman Sakno 2011-05-12 07:39:39 UTC
Correction: this issue is actual for JSON serialization/deserialization only(through DataContractJsonSerializer).