I host 2 WCF web services and 1 standard .NET web service from an application directory. The .NET service and 1 of the WCF services works perfectly; however, the other WCF service is returning the following error:
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'.
Both WCF web services have the line
<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 just fine.
Also, changing
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
to
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
in the web.config also allows all web services to function.
This problem is presenting on both IIS7 and our staging enviorment hosted on SBS2003 running IIS6.
Thank you in advance for all of your help.
Jake
UPDATE:
I was able to get it to work by deleting the application on my development system; however, the problem still persists on our staging server, even after deleting the application and recreating it there.
WORK AROUND:
What a pain.
You can not host 2 different framework version of service under single application pool. What i mean is that if you have hosted 2 WebService ( One is using Framework 2.0 and another is using framework 4.0) under single application pool, any one service will work. Second will never work
SOLUTION:
It should work now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With