Web Service Configuration Problem

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.

+8
web-services wcf
source share
2 answers

WORK AROUND:

  • Remove Application from IIS
  • Restore Directive
  • Create a new application pool.
  • In the directcotry properties, create an application and associate it with the new application pool.
0
source share

In the same application pool, you cannot host two different versions of the framework service. I mean, if you host 2 WebService (One uses Framework 2.0 and the other uses Framework 4.0) in one application pool, any service will work. The second will never work

DECISION:

  • Create 2 different application pools. App1 (Target Framework 2.0) and App2 (Target Framework 4.0)
  • Assign App1 pool to this service, which was developed in Framework 2.0.
  • Assign the App2 pool to this service, which was developed in Framework 4.0.
  • Restart IIS

Now it should work.

+3
source share

All Articles