title: The best way to manage multiple client endpoint configurations (IP-address etc) in app.config
body: <p>We developing a system where the client application is a .NET client communicating with a server using web services. We need to be able to deploy the client with different configuration options, e.g. IP address etc.
  So far we have managed this by basically commenting/un-commenting different configurations in app.config, like:</p>
  
  <pre><code>&lt;!--&lt;client&gt;
      &lt;endpoint address="https://localhost/services/service1"
          binding="customBinding" bindingConfiguration="ServiceSoapBinding"
          contract="ServiceReference.Service1" name="ServiceImplPort" /&gt;
      &lt;endpoint address="https://localhost/services/service2"
          binding="customBinding" bindingConfiguration="ServiceSoapBinding"
          contract="ServiceReference.Service2" name="ServiceImplPort" /&gt;
      ...
      ..
  &lt;/client&gt;--&gt;
  &lt;client&gt;
      &lt;endpoint address="https://prod.example.com/services/service1"
          binding="customBinding" bindingConfiguration="ServiceSoapBinding"
          contract="ServiceReference.Service1" name="ServiceImplPort" /&gt;
      &lt;endpoint address="https://prod.example.com/services/service2"
          binding="customBinding" bindingConfiguration="ServiceSoapBinding"
          contract="ServiceReference.Service2" name="ServiceImplPort" /&gt;
      ...
      ..
  &lt;/client&gt;
  </code></pre>
  
  <p>But it seems obvious that this is not the best solution to the problem, it becomes a bit unmanageable as the number of configuration alternatives grow. Any suggestions how to improve this are most welcome.</p>
  
  <p>Regards, Ola</p>