Can't Activate WCF service

First step in troubleshooting a WCF application is to bring up a browser and type in the service URI. So based on the client: you'd navigate to http://global-kazway.kz/Service1.svc

Now see what kind of results you get. Exception? The service screen? Usually you can get your best information from this screen! Sometimes it points out what your issue is such as missing a behavior.

Compare your web.config with the deployed web.config entries. You may find something there as well. Finally you may just have to manage security on your folder. But the browser display could spell everything out for you very clearly.


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.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />

This element should be placed in <system.serviceModel>


i'm working over WCF and it worked fine on localhost.After i placed it to the production server, it thows me an exception "The requested service, 'http://global-kazway.kz/Service1.svc' could not be activated. See the server's diagnostic trace logs for more information"

This MSDN article describes how to configure tracing on the server. Once you've done that you can look at the server's diagnostic trace logs, and will likely find the problem.

Tags:

Wcf