WCF and Multiple Host Headers

WCF may be on its way out with the prevalence of REST, but it its still used in many places in .NET to connect to external services.  If you experience this error with a WCF service:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. Parameter name: item

adding the following baseAddressPrefixFilters in should fix it:

<serviceHostingEnvironment aspNetCompatibilityEnabled=true>
<add prefix=http://www.XXXXX.co.uk:80/>

Leave a Reply

Your email address will not be published. Required fields are marked *