WCF Service Reference - Getting “XmlException: Name cannot begin with the '<' character, hexadecimal value 0x3C” on Client Side

后端 未结 6 1625
醉梦人生
醉梦人生 2021-02-03 23:54

I have a smart client application communicating with its server via WCF. Data is created on the client and then sent over the service to be persisted. The server and client use

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 00:02

    Personnally, I got the same problem with serialization of class hierarchy (not DataTables).

    My problem was not related to automatic property at all, in fact I have many. My problem was that I forgot to include reference to "System.Runtime.Serialization" in one of my dll and I also forgot to add some attributes [DataContract] on some classes referenced by upper [DataMember] attributes up in the hierarchy.

    To track my problem I started from my root class and removed some [DataMember] down the hierarchy until it pointed out the exact problem. It could takes some times depending on your hierarchy levels...

    Hope it helps! Eric

提交回复
热议问题