0

I have a WCF REST service that is exposed both "locally" and in the cloud via the webHttpRelayBinding and the Azure Service Bus.

This works great on my IIS 7.5 Express instance, but when I deploy it to an Windows Server 2003 / IIS 6 environment, I start getting 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'.

I've read that I need to completely remove any dependencies to ASP.NET to resolve this problem (see here). I've refactored my code so that the assembly that contains the service definition doesn't have any reference to System.Web, but I still get the error.

So I assume what this means is that I can't host the service in IIS at all. If that's the case, is my only option have a Windows Service do the hosting? WAS isn't available on Win2k3.

RMD
  • 3,421
  • 7
  • 39
  • 85

1 Answers1

0

Did you try removing the aspNetCompatibilityEnabled attribute from the serviceHostingEnvironment element in your web.config?

WAS itself it's available on Win2k3 (that's how webhosted WCF services work), but IIS' application pool and activation model is slightly different that in newer versions of it.

Ramiro Berrelleza
  • 2,254
  • 1
  • 15
  • 27