Add Service Reference is ALWAYS generating xmlserializer and not DataContractSerializer

懵懂的女人 提交于 2019-12-11 02:39:00

问题


i have a service : http://chronicpainhostservice2.cloudapp.net/Service1.svc i consume it in silverlight 5.0 application. and it all worked fine. However, when i adding this service to the project using "add service reference" it ALWAYS generating xmlserializer

One more thing - when i try to add it to simple windows application it is generating DataContractSerializer , so the problem is not in the server.

How can i force silverlight to generate DataContractSerializer ? Thanks!


回答1:


It looks like svcutil try to verify some conditions before using the appropriate Serializer. here are some details : http://kjellsj.blogspot.com/2008/03/wcf-datacontractserializer-schema-rules.html

have you tried to force the serializer used by calling manually svcutil : svcutil http://chronicpainhostservice2.cloudapp.net/Service1.svc /ser:DataContractSerializer



来源:https://stackoverflow.com/questions/16245728/add-service-reference-is-always-generating-xmlserializer-and-not-datacontractser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!