I have a valid for a XmlSerializer type:
public class MyItem
{
public MyItem() {
Values = new List<string>();
}
public List<string> Values { get; private set; }
}
It successfully serialized and deserialized (Full code example here http://ideone.com/s2PvSB). But, I can not generate .XmlSerializers.dll for this type, SGen failed with:
Microsoft (R) Xml Serialization support utility
[Microsoft (R) .NET Framework, Version 4.0.30319.33440]
Copyright (C) Microsoft Corporation. All rights reserved.
EXEC : error : Unable to generate a temporary class (result=1).
EXEC : error CS0200: Property or indexer 'TestSGen.MyItem.Values' cannot be assigned to -- it is read only
SGen called from a PostBuild event as
"$(TargetFrameworkSDKToolsDirectory)SGen.exe" /Assembly:"$(TargetFileName)" /Type:"TestSGen.MyItem" /Force
Is it a bug in SGen or [somewhere] documented behavior?