wcfiisporttcpportsharing

Why does my self-hosted WCF service take IIS offline?


As you may know, IIS 6+ can share port 80 with other HTTP applications running in different processes.

However my self-hosted WCF service seems to take IIS offline. When the WCF service is running, all HTTP requests go to the service. When I stop the service, all HTTP requests go to IIS. This is despite the fact that the two applications are using very unique URI paths. What's the deal? How do I get them to play together nicely?

EDIT: My WCF service uses a custom binding with an HttpTransportBindingElement

Sorry if this belongs on serverfault. I'm not sure if it's a configuration issue or code issue.


Solution

  • After a lot more experimentation, I've come to a conclusion.

    It looks like the problem is caused when the endpoint base address of the WCF service is the same as the base address of IIS. In other words if an endpoint exists at http://localhost/, it will take over and handle all incoming HTTP requests.

    So even if your WCF subpaths are different from IIS, the base endpoint address has to be something other than http://localhost/.