Search

XmlSerializer does not handle properties with mixed access modifiers by VECOZO

Closed
as Won't Fix Help for as Won't Fix

1
0
Sign in
to vote
Type: Bug
ID: 96882
Opened: 5/25/2006 2:17:36 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When serializing a class with a property with mixed access XmlSerializer modifiers I get an exception

System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0200: Property or indexer 'Vecozo.Instrumentation.Configuration.InstrumentationConfiguration.Scope' cannot be assigned to -- it is read only
Details (expand)
Product Language
English
Version
Visual Studio 2005
Category
XML
Subcategory
 
Operating System
Windows XP Professional
Steps to Reproduce
Serialize a class with the following property:

public string Scope
{
get { return _scope;}
internal set {_scope = value;}
}

Actual Results
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0200: Property or indexer 'Vecozo.Instrumentation.Configuration.InstrumentationConfiguration.Scope' cannot be assigned to -- it is read only
Expected Results
Similar results as when serializing a class with teh following property:

public string Scope
{
get { return _scope;}
}

Thta is, no exception and the property is not set at serialization.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 12/4/2006 at 9:22 AM
Thank you for submitting this issue. Unfortunately, we have decided that it will not be addressed because the risk of the fix outweighs its benefit. By the time the next opportunity to make this change comes about, the hope is that the new serialization technologies in a future version of the Windows Communication Foundation will address your scenario. Specifically, the DataContractSerializer in the Windows Communication Foundation handles mixed access modifiers. If this issue is causing significant negative business impact, please contact Microsoft Product Support Services. I regret that we could not provide a better resolution. Rest assured that we seriously considered this issue - a Won't Fix decision is never easy to make.
-- Eugene Osovetsky, Program Manager, XML Messaging / Data
Posted by Microsoft on 6/30/2006 at 3:02 PM
Thank you for submitting this issue. We will investigate this when we will be planning a new version of the Framework in which we will have the opportunity to update the XmlSerializer. If this is an issue with real business impact which requires more urgent attention, please contact Microsoft Product Support Services.
-- Eugene Osovetsky, Program Manager, XML Messaging / Data
Sign in to post a workaround.