title: Getting Error "This collection already contains an address with scheme http" with WCF on local machine
body: <p>I'm trying out WCF for the first time and getting the following error when I try to instantiate the host:</p>
  
  <p>This collection already contains an address with scheme http...</p>
  
  <p>I have found a lot of other references to this and tried some of the solution to no avail. One fairly common thread that does not apply to me is that the problem is on a web server of some sort. I'm just running everything from my local machine.</p>
  
  <p>One interesting symptom I found is that I'm developing a c# Forms app. Originally my top level form object inherited my service interface instead of a separate Service class. When I implement this way, there is no error on the host side but I have been having trouble on the client side.</p>
  
  <p>Based on this solution:
  <a href="https://stackoverflow.com/questions/1252791/how-to-solve-the-channeldispatcher-is-unable-to-open-its-ichannellistener-erro">How to solve &quot;The ChannelDispatcher is unable to open its IChannelListener&quot; error?</a></p>
  
  <p>...I decided to separate the service host into a separate object. That's when I start seeing the problem.</p>
  
  <p>The ServiceContract is simple enough:</p>
  
  <pre><code>[ServiceContract]
  public interface ISSAService
  {
      [OperationContract]
      void CreateSpaMonitor();
  }
  </code></pre>
  
  <p>I instantiate the service like this:</p>
  
  <pre><code>        Uri baseAddr = new Uri("http://localhost:8000/SSAService");
          ServiceHost localHost = new ServiceHost(typeof(SSAService), baseAddr);
  </code></pre>
  
  <p>Where SSAService is the implementation of the Service interface.</p>
  
  <p>If I change the second line to the following (and implement the interface...) the error goes away:</p>
  
  <pre><code>        Uri baseAddr = new Uri("http://localhost:8000/SSAService");
          ServiceHost localHost = new ServiceHost(typeof(SSAManager), baseAddr);
  </code></pre>
  
  <p>Where SSAManager is my top level Forms class...</p>
  
  <p>Then I run into a client side problem which is where I started....</p>
  
  <p>I have tried changing the port number and that doesn't seem to affect anything.</p>
  
  <p>I'm new to WCF so maybe I'm missing something obvious.</p>
  
  <p>Thanks.</p>