WCF error:
The service could not be activated because it does not support ASP. ASP. NET compatibility has been enabled for this application. Either turn off ASP. NET compatibility mode in Web. config, or add the Aspnetcompatibilityrequirements attribute to the service type and set Requirementsmode to "allowed" or " Required ".
error (appearance) reason :
This is generally because the program adds AJAX-enabled WCF services, and when you add a WCF service, you see the above error when you browse the WCF service, and the WCF service that browses Ajax does not error. There is no error when WCF services are not added with Ajax.
Solve:
1.
Add or modify in Web. config
<system.serviceModel>
<servicehostingenvironment aspnetcompatibilityenabled= "Fales" multiplesitebindingsenabled= "true"/>
</system.serviceModel>
2. Add before service: [aspnetcompatibilityrequirements (Requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] (The WCF service with AJAXD enabled is added by default)
Another: Metadata publishing error for this service is currently disabled
Workaround: Add in Web. config:
<system.serviceModel>
<behaviors>
<serviceBehaviors> <behavior name= "" > <servicemetadata httpgetenabled= " True "/> </behavior> </serviceBehaviors> </behaviors>
</system.serviceModel>
Unable to activate service because it does not support ASP.