Development error handling records (service cannot be activated because it does not support ASP. NET compatibility)

Source: Internet
Author: User

Unable to activate service because it does not support ASP. NET compatibility

Error message:Service cannot be activated because it does not support ASP. NET compatibility. ASP. NET compatibility has been enabled for this application. Disable ASP. NET compatibility mode in Web. config or add the aspnetcompatibilityrequirements attribute to the service type and set requirementsmode to allowed or required ".

 

By default, Asp. net compatibility support is disabled, but many times you need to enable ASP. net compatibility to use ASP.. net. For more information, see http://msdn.microsoft.com/zh-cn/library/ms752234.aspx.

To enable compatibility, perform two steps: first, add the following mark to the service class:

[Aspnetcompatibilityrequirements (requirementsmode = aspnetcompatibilityrequirementsmode. Required)]
Public class appruntimestatesvc: iappruntimestatesvc
{

// Service code.

}

Add the following content to the <system. servicemodel> section of Web. config:
<Servicehostingenvironment multiplesitebindingsenabled = "true" aspnetcompatibilityenabled = "true"/>

Note that the Framework 3.5 is supported by default, and the 4.0 is not supported by compatibility by default.

Related Article

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.