title: Remote debugging WCF client application - Can't connect to host
body: <p>I'm writing a WCF solution that includes a mobile app for Windows RT (Windows Store app).  </p>
  
  <p>The mobile app works fine when I run it from the dev machine, with the WCF host running on the same machine.  I tried to test it on my MS Surface RT via Remote Debugging.  This starts to work.  The app does start on the Surface, but as soon as I do something that requires it to access the WCF host (which is running on the dev machine), I get the following exception:</p>
  
  <pre><code>System.ServiceModel.EndpointNotFoundException was unhandled
  Message: An unhandled exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll
  Additional information: There was no endpoint listening at http://192.168.0.101:8000/Service1 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
  </code></pre>
  
  <p>There is no inner exception.  192.168.0.101 is the static IP of the dev machine.</p>
  
  <p>The Windows Firewall is disabled on the dev machine, and there are no other firewalls on it.  I am able to ping that same IP address from the Surface, so I know it can see the dev machine.</p>
  
  <p>Again, this works just fine when the mobile app is running on the dev machine along with the WCF host.  So, I'm not sure what the issue is.</p>
  
  <p>Here's the code where the endpoint is created in the host:</p>
  
  <pre><code>    ServiceHost hostA = null;
  
      try
      {
          hostA = new ServiceHost(typeof(Service1), new Uri("http://192.168.0.101:8000") );
          hostA.AddServiceEndpoint(typeof(IService1), new BasicHttpBinding(), "Service1");
  
          hostA.Open();
  
          Console.WriteLine();
          Console.WriteLine("Host started.  Press Enter to terminate host.");
          Console.ReadLine();
  
      }
      finally
      {
          if (hostA.State == CommunicationState.Faulted)
              hostA.Abort();
          else
              hostA.Close();
      }
  </code></pre>
  
  <p>And in the client:</p>
  
  <pre><code>    var myBinding = new BasicHttpBinding();
      var myEndpoint = new EndpointAddress("http://192.168.0.101:8000/Service1");
      var myChannelFactory = new ChannelFactory&lt;ToOrson.IService1&gt;(myBinding, myEndpoint);
  
      MyService = myChannelFactory.CreateChannel();
  </code></pre>
  
  <p>What could the problem be?</p>