Wednesday, March 11, 2009

WCF error: "This collection already contains an address with scheme http"

WCF error: "This collection already contains an address with scheme http".

The explanation is that "WCF services hosted in IIS can have only one Base Address".

Easy fix:

Just add the following lines in the system.serviceModel section:

<serviceHostingEnvironment>

<baseAddressPrefixFilters>

<add prefix="http://www.example.com"/>

</baseAddressPrefixFilters>

</serviceHostingEnvironment>