Can't Activate WCF service

后端 未结 7 1628
甜味超标
甜味超标 2020-12-16 10:05

I\'m working over WCF and it worked fine on localhost. After I placed it on the production server, it thows an exception

The requested service, \'htt

7条回答
  •  孤城傲影
    2020-12-16 10:48

    I'm working on a project and I faced the same problem. When I checked the Event Viewer to trace the error, I found where the problem was.

    Event Viewer message:

    Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/7540993
     Exception: System.ServiceModel.ServiceActivationException: The service '/CODWebService/Service1.svc' cannot be activated due to an exception during compilation.  The exception message is: Memory gates checking failed because the free memory (164065280 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. ---> System.InsufficientMemoryException: Memory gates checking failed because the free memory (164065280 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
    

    Then I added the below code to my service's web.config file.

    
    

    This element should be placed in

提交回复
热议问题