Unable to activate service because it does not support ASP.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.