Sunday, July 02, 2017

serviceHostingEnvironment serviceActivations could not be found

Server Error in / 'WCF application. The type 'WCFNameService.ClassName' provided as the Service attribute value in the ServiceHost directive, or provided in the configuration
element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


This simple exception started to nagging me nearly 30 minutes. It error message were so clear and precise, that the name namespace in my service and the class implementation is not available.

I have double checked every thing is fine and my solution also rebuild without error and warning. Still I am not able to access the service end point.

To resolve this problem,

Open your service end point file in markup mode, hitting the F7 key is handy.
Check the Service and Code behind attributes are correctly pointing the namespace and class.

In my case, both are correct, still I am not able to access the service end point (.svc) file with ?wsdl query parameter on my IIS hosted WCF service application.

Solution is very straight forward, you simply need to "Rebuild the Solution" not just project.

Later I have realized, without rebuild the solution, I have started the IIS hosting process on my server.

Skipping this simple step, took my nearly an hour .

Hope it will be useful to someone.