How can I tell a certain WCF Service to use DataContractSerializer or NetDataContractSerializer?
Suppose I succeed, will the proxy generated automatically identify it and use the correct one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DataContractSerializeris used by default. On the service side you can control used serializers with behaviors. By default you have availableDataContractFormatandXmlSerializerFormatattributes for this. These attributes can be applied on service contract, service implementation or on operations. On client side svcutil will use data contract serialization if types description are serializable byDataContractSerializerotherwise it will useXmlSerializer.NetDataContractSerializerdoesn’t have behaviour prepared – you must create it yourselves. It is also not recognized by clients because when you useNetDataContractSerializeryou will share assemblies with types (data contracts, service contracts) with client so you can share behaviour as well and mark service contract with that behaviour directly.