WCF Service returning “requested service '…' could not be activated” the first time it's accessed from an MVC site

后端 未结 10 1915
遥遥无期
遥遥无期 2021-02-02 09:10

We have a WCF service (with no security) that is being accessed by an MVC3 website.

On the developer machines we have no problems with it but when our TeamCity setup bui

10条回答
  •  遥遥无期
    2021-02-02 09:47

    I had that problem too, what I did is:

    • Go to the directory in the file system where the service resides
    • you will have 2 files for the service
      • yourService.svc
      • yourService.svc.cs
    • Open the file yourService.svc and make sure that your service is configured, and the code behind looks like this:

      <%@ ServiceHost Language="C#" Debug="true" Service="YourNamespace.yourService.svc" CodeBehind="yourService.svc.cs" %>
      

    I fixed my issue that way. I hope it helps!

提交回复
热议问题