WCF Configuration Hell?

前端 未结 7 884
迷失自我
迷失自我 2021-02-08 01:20

I hate WCF setup with endpoints, behaviors etc. I believe all these things should be performed automatically. All I want to do is to return JSON result from my WCF service. Here

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 01:35

    I am using .net framework 4, VS2010. I made a dummy mistake in my global.asax.cs that instead of creating an instance of WebServiceHostFactory I punched WebScriptServiceHostFactory through intellSense. As a result I got the same error:

    Endpoints using 'UriTemplate' cannot be used with 'System.ServiceModel.Description.WebScriptEnablingBehavior'.

    I corrected the instance to WebServiceHostFactory in my global.asax.cs, I don't see the error anymore.

提交回复
热议问题