Loading ...

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

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

 /5
0 (0votes)

While working with WCF application I was getting the following error:

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'.




FIX:
The fix to solve above issue was to add AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)  the service class
like this:

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class MyService : IMyService

 

Comments (no comments yet)

Top Posts