Pieter Brinkman

Running WCF on IIS 5 (Windows XP)

1 min readpieterIISMicrosoft

After running WCF on my Vista laptop (IIS7) I needed to deploy the application on some Windows XP computers. Again some strange errors occurred:

Error Description: "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 is that WCF cannot handle more than one identity (host headers) per website. At first I configured IIS to have one HostHeader. That solution was just too dirty. So I kept on searching the internet.

You can fix this problem by adding prefix-key(s) in the baseAddressPrefixFilters section of the Web.Config:

<system.serviceModel>  
<serviceHostingEnvironment>  
<baseAddressPrefixFilters>  
        <add prefix=”http://www.local.develop”/>

</baseAddressPrefixFilters>  
</serviceHostingEnvironment>  
</system.serviceModel>

Hope this helps.

Sources:
http://geekswithblogs.net/robz/archive/2007/10/02/WCF-in-IIS-with-Websites-that-have-Multiple-Identities.aspx
http://blogs.msdn.com/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx