I host 2 WCF web services and 1 standard .NET web service from the application directory. The .NET service and 1 of the WCF services work fine; however, another WCF service returns the following error:
The service cannot be activated because it does not support ASP.NET compatibility. Compatibility with ASP.NET is included for this application. Disable ASP.NET compatibility mode in the web.config file, or add the AspNetCompatibilityRequirements attribute to the service type with the RequirementsMode parameter as Allowed or Required.
Both WCF web services have a string
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
and the web.config file has
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
To add more confusion to the mix when I change
AspNetCompatibilityRequirementsMode.Allowed
to
AspNetCompatibilityRequirementsMode.Required
the service works very well.
Also change
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
to
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
in web.config also allows all web services to function.
This problem is presented both on IIS7 and on our intermediate environment hosted on SBS2003 with the launch of IIS6.
Thank you in advance for your help. Jake
UPDATE:
I was able to get it working by uninstalling the application on my development system; however, the problem still persists on our staging server, even after the application has been uninstalled and recreated.
WORK AROUND:
- Remove Application from IIS
- Restore Directive
- Create a new application pool.
- In the directcotry properties, create an application and bind it to the new application pool.
Such a pain.
Jacob hulse
source share