Content Type text/xml; charset=utf-8 was not supported by service

前端 未结 10 1785
北海茫月
北海茫月 2020-12-01 09:59

I have a problem with a WCF service. I have a console application and I need to consume the service without using app.config, so I had to set the endpoint, etc. by code. I d

10条回答
  •  不思量自难忘°
    2020-12-01 10:30

    I was also facing the same problem recently. after struggling a couple of hours,finally a solution came out by addition to

    Factory="System.ServiceModel.Activation.WebServiceHostFactory"
    to your SVC markup file. e.g.
    ServiceHost Language="C#" Debug="true" Service="QuiznetOnline.Web.UI.WebServices.LogService" 
    Factory="System.ServiceModel.Activation.WebServiceHostFactory" 
    

    and now you can compile & run your application successfully.

提交回复
热议问题