WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

后端 未结 19 2432
情书的邮戳
情书的邮戳 2020-11-27 18:30

I\'ve got a WCF Service running on my local IIS server. I\'ve added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automa

19条回答
  •  臣服心动
    2020-11-27 18:39

    In my WCF serive project this issue is due to Reference of System.Web.Mvc.dll 's different version. So it may be compatibility issue of DLL's different version

    When I use

    System.Web.Mvc.dll version 5.2.2.0 -> it thorows the Error The content type text/html; charset=utf-8 of the response message

    but when I use System.Web.Mvc.dll version 4.0.0.0 or lower -> it works fine.

    I don't know the reason of different version DLL's issue but by changing the DLL's verison it works for me.

    This Error even generate when you add reference of other Project in your WCF Project and this reference project has different version of System.Web.Mvc DLL or could be any other DLL.

提交回复
热议问题