Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 3.0
General Reference
<services>
<service>
<host>
<baseAddresses>
 <baseAddress>

  Switch on low bandwidth view
This page is specific to
.NET Framework 3.0

Other versions are also available for the following:
<baseAddress>

Represents a configuration element that specifies the base addresses used by the service host.

<system.serviceModel>

  <client>

    <endpoint>

      <host>

        <baseAddresses>

          <baseAddress>

									
									<baseAddress baseAddress="string" />
								

Type

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description

baseAddress

A string that specifies a base address used by the service host.

Child Elements

None.

Parent Elements

Element Description

<baseAddresses>

A collection of baseAddress elements.

Footer image

Send comments about this topic to Microsoft.
© Microsoft Corporation. All rights reserved.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Caution this page is not right      ScottSharpe   |   Edit   |   Show History

Read the page above and you might think that your configuration file should look like this
<configuration>
<system.serviceModel>
<services>
<service name="MyNameSpace.MyServiceType">
<host>
<baseAddresses>
< baseAddress baseAddress="http://localhost:8000/MyService/"/>
< baseAddress baseAddress="net.tcp://localhost:8010/MyService/"/>
</baseAddresses>
</host>
<endpoint address="Calculator" binding="basicHttpBinding" contract="MyNamespace.IServiceContract" />
</service>
</services>
</system.serviceModel>
</configuration>

But no… baseAddress element doesn’t work that way it works like this:

<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/MyService/"/>
<add baseAddress="net.tcp://localhost:8010/MyService/"/>
</baseAddresses>
</host>

What clued me in was the initial bug at the top. The hierarchy doesn't match properly. After some random hunting around I saw some examples where the <add element is used and gave it a shot. Bingo!

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker