views:

1961

answers:

1

I have read the documentation for this element but still fail to understand what its purpose is. Here is a sample of how I've seen it used in examples:

<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <add prefix="http://localhost:5100/"/&gt;
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

I want to understand what this does that the base addresses in a service node doesn't do. I don't understand what this element is actually used for.

+2  A: 

A WCF service host will only allow a single base address per scheme (HTTP in this case). Now if you deploy a WCF service on an IIS configured with multiple base addresses, for example http://www.mysite.com and http://mysite.com you will see an error. Using the baseAddressPrefixFilters you can filter one of the two base addresses and your service will run just fine.

Maurice