Original http://www.cnblogs.com/xtechnet/archive/2012/06/06/2537979.html
An error occurs during testing and publishing to a virtual directory. The service cannot be activated because Asp.net compatibility is not supported.
Error message:
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 '.
Do not look at the English error information, and you will be confused. The error information is clearly displayed:
1. Add <servicehostingenvironment aspnetcompatibilityenabled = "false"> to Web. config. Note that this is stored in <system. servicemodel>.
2. Add the additional attributes aspnetcompatibilityrequirements to the WCF Service class, as shown in figure
Author: xtechnet
Source: http://xTechnet.cnblogs.com/
Poor ability, but willing to share it with others. Please leave a message if you have any mistakes. Contempt .
The copyright of this article is shared by the author and the blog. You are welcome to repost this article, but you must keep this statement without the author's consent, Hao In Article The original text connection is given at an obvious location on the page, otherwise it will be retained. Contempt Your rights.