Thursday, 19 January 2012

WCF Error - This collection already contains an address with scheme http.

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
I've found two solutions to this error depending on which version of the .NET framework you are using. You need to update the web.config with the following:

.NET 4.0

<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

.NET 2.0 - 3.5

<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <add prefix="http://www.yourdomain.com"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

No comments: