0
votes

I have a solution with one WPF (4.0) project, one WCF (4.0) project, one ASP.NET (4.0) and one Silverlight 4 project.

I started developing the WCF service and the WPF client which worked fine, I also used the same WCF service with the ASP.NET project for fetching data. Everything worked just fine. However, silverlight didn't want to play at all, so I created a new .svc file as a Silverlight enabled WCF service. And now, all of a sudden the ASP.NET and the WPF won't bother communicating with the WCF, the error I get is:

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

So exactly HOW can I have the same WCF project (albeit not the same .svc file in the project) for both Silverlight and WPF??)

Any help will be greatly appreciated.

//JaggenSWE

1

1 Answers

1
votes

You can try changing it to "Allowed" instead of "Required".

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class SomeWCFService : ISomeWCFService