This service implements '2' contracts. InvalidOperationException

246 views Asked by At

I have a WCF service project that I am trying to get up and running on my local development machine.

When I hit the .SVC from IE8 running in Cassini it works no problem.

When I hit the .SVC from IE8 running in IIS I get the following server error.

This service implements '2' contracts. To use WebScriptServiceHostFactory, you must implement one contract per service. If you must use multiple contracts, please use a regular ServiceHost.

I would appear I have an issue with my IIS configuration. I have a co-worker that has the project running through IIS on his machine and we have gone through and matched our Windows Features lists to be sure we have the same IIS and WWW features installed in Windows 7.

I have also re-registered aspnet with IIS for 4.0 with no change in the error.

1

There are 1 answers

2
Jaimal Chohan On

Well, the a reason why works in Cassini and not in IIS7 is that Cassini emulates IIS6 and there have been a significant number of changes to website configuration between IIS6 and IIS7. You should most definitely install and use IIS Express 7.5 as your integrated development web host the instead of the default Cassini browser.

Now, you've checked your features but have you checked your IIS7 configuration? Are you sure that the site is running in the correct (.NET 4) app pool. Have you also ensure that it is running in the correct mode (Integrated).