24. June 2010 14:30
After deploying a project from development environment running off of the VS development Web server Cassini to a production box using IIS, I noticed that all of my WCF service were all failing with the same HTTP 500 error:
The problem is that IIS needs to determine which base address in the bindings to host the service. However, WCF services only allows one service hosted under a site to be bound to one base address for a scheme. In situations where you have multiple services being hosted under a single site, the binding must specify a base address to use filter requests to t he specific service.
To resolve the issue, simple provide the base address in the baseAddressPrefixFilters section of the web.config:
By adding the prefix above, only requests with the specified base address above will be passed through. All others will be blocked and a HTTP 500 error returned to the client:
"System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are "