I was trying to deply a WCF service to one of my web servers the other day and ran into a problem. I kept getting the following error message:p>
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.Parameter name: item
The problem didn't happen on my local machine but did on the web server making it a little difficult to figure out what was causing it. It happened on the server because my web server is in a shared hosting environment in which case the WCF service also needs to know the host header. To do this I navigated to <system.serviceModel> in the web.config and added the following:
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix=http://MyHostHeader />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
Tags: WCF