Reputation: 419
I am working on a Silverlight Project that uses WCF as backend. The project uses Autofac for IoC (both frontend as backend).
The WCF Services are hosted in IIS7 & have configured correctly (endpoints, aspnetcompatibilityenabled, ..).
When debugging the project in VS 2012, random services sometimes throw a ServiceActivationException, without any information. Sometimes a rebuild fixes the problem, sometimes IISReset, sometimes invoking the service with the wcftestclient. The last solution always works though..
Has anyone experienced similar problems?
Please don't hesitate to ask for more info if needed..
Thnx!
Upvotes: 1
Views: 1775
Reputation: 419
I found out what was causing this issue. I was working in a VM hosting multiple WCF services in IIS. The VM had only two gigs of ram assigned. The latter didn't cause any performance issues, but was a problem for the w3p process hosting the services.
Memory gates checking failed because the free memory (43732992 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.
My service only failed when insufficient memory was available. Adding the configuration element and upscaling the ram-memory in the virtual machine fixed the problem.
Upvotes: 2