Anyone have any idea why the following XML generated by a data contract serializer in C# works just fine in Windows but not under Linux on Mono?
The XML:
<Message i:type="UserMessage" xmlns="http://schemas.datacontract.org/2004/07/NetTunnel"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><type>UserMessage</type>
<nick>Unnamed</nick><services><Service><enabled>true</enabled><port_ranges i:nil="true"/>
<service_name>vent</service_name></Service></services><state>Created</state>
<userid>1</userid></Message>
The error:
Unhandled Exception: System.Runtime.Serialization.SerializationException: Deserializing
type 'System.Object'. Expecting state 'EndElement'. Encountered state 'Element' with
name 'enabled' with namespace 'http://schemas.datacontract.org/2004/07/NetTunnel'.
It also gives me an error if there are no services listed (xml tag <services/>
). The services variable is of type List<Service>
. Is this just a type Mono can't handle? Would another type be more appropriate? Or is it something else entirely?