Add Service Reference is ALWAYS generating xmlseri

2019-07-15 13:43发布

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条回答
我命由我不由天
2楼-- · 2019-07-15 14:09

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

查看更多
登录 后发表回答