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

后端 未结 10 1913
遥遥无期
遥遥无期 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:42

    I've hit the same "Could not load type 'System.Runtime.CompilerServices.AsyncStateMachineAttribute'", which I found out was because I had built my application using VS 2012 RTM, but then tried to deploy it on a machine that only had 4.5 Beta. The AsyncStateMachineAttribute is a new type added after Beta.

    0 讨论(0)
  • 2021-02-02 09:44

    I ran into this same issue today and instead of RAM being the problem it was disk space. After freeing up space, I had to restart the Application Pool and the issue was resolved.

    0 讨论(0)
  • 2021-02-02 09:44

    Everytime I have the same problem, I restart my computer and it works well. It frees up memory

    0 讨论(0)
  • 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!

    0 讨论(0)
提交回复
热议问题