When aspnetcompatibilityenabled = "true" When, SL cannot reference the WCF Service,
When browsing the file of the Servics. SVC in WCF, an error is prompted, as shown below:
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 '.
When aspnetcompatibilityenabled = "false", an error occurs during the test run:
An unhandled exception ('unhandled error in Silverlight Application
Code: 4004
Category: managedruntimeerror
Message:
System. servicemodel. domainservices. Client. domainoperationexception:
This project includes the WCF Service and RIA service. What should I do?
Solution:
First, set aspnetcompatibilityenabled = "true" in Web. config"
Next, mark the following attribute on the WCF Service Class
Using system. servicemodel. activation;
[Aspnetcompatibilityrequirements (
Requirementsmode = aspnetcompatibilityrequirementsmode. Allowed)]
Public class service2: classlibrary1.iservice2
{
...