BaseAddress will be ignored when WCF hosted in IIS

Published on Tuesday, August 2, 2011

The baseAddress element will be ignored when WCF hosting in IIS.

The following is an example of WCF config:

<?xml version="1.0" encoding="utf-8" ?> 
      <service name=""> 
            <add baseAddress="http://localhost/blah" /> 
        <endpoint �. /> 
        <endpoint � /> 

the baseAddresse element will be completely ignored if your WCF hosted in IIS. The base address will be determined by the web site and virtual directory into which your WCF service is placed.

Also, if using self-hosting, baseAddress is not required either.

In some cases, if you provide base address, all other endpoints can use relative address which relative to the base address.