Type 'WCFService.UserDataContract' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.。)此时,类中所有公有的字段和属性都将进行序列化。
当然,在WCF架构中,在数据的序列化时我们应尽量使用DataContractSerializer这种机制。它对于数据的自定义提供更强大的支持
引自:http://www.cnblogs.com/wcfgroup/archive/2008/06/03/1213119.html