WCF error: The service cannot be activated because it does not support ASP.NET compatibility

I got the following error when I was trying to host my WCF service in IIS 7.5 using WsHttpBinding

The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as ‘Allowed’ or ‘Required’.

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.
Exception Details: System.InvalidOperationException: The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as ‘Allowed’ or ‘Required’.

Solution:

One of the  solution is to turn-off ASPNet compatibility in service configuration file

<serviceHostingEnvironment aspNetCompatibilityEnabled="false"/>. It worked for me.

One thought on “WCF error: The service cannot be activated because it does not support ASP.NET compatibility

  1. Pingback: WCF error: The service cannot be activated because it does not support ASP.NET compatibility - My experiments with SharePoint, Azure and .NET using Visual Studio

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.