Closed DaTeL237 closed 9 years ago
Have you tried adding any xml attributes to get it working?
When I add the following XML attributes to the SubType definitions (not the field definitions) it works ok:
[System.Xml.Serialization.XmlType(TypeName = "SubType", Namespace = "Example.MessageOne")]
public enum SubType
(..)
[System.Xml.Serialization.XmlType(TypeName = "SubType", Namespace = "Example.MessageTwo")]
public enum SubType
Ok, one solution could be to add Namespace with the Matching the c# namespace including the class hierarchy
With this I will also make XmlSerialization an optional command line flag so it won't be included by default.
On 2013-06-10 16:31, DaTeL237 wrote:
When I add the following XML attributes to the SubType definitions (not the field definitions) it works ok:
[System.Xml.Serialization.XmlType(TypeName = "SubType", Namespace = "Example.MessageOne")] public enum SubType (..) [System.Xml.Serialization.XmlType(TypeName = "SubType", Namespace = "Example.MessageTwo")] public enum SubType — Reply to this email directly or view it on GitHub https://github.com/hultqvist/ProtoBuf/issues/11#issuecomment-19202059.
I won't work on this myself but if anyone else starts working to fix this I will help to integrate it into working code.
XmlSerializer cannot always be created with the generated System.Serializable attributes.
An InvalidOperationException is raised when creating an XmlSerializer with an inner exception with message:
The following .proto definition and C# code reproduce the exception:
.proto definition:
C# code: