title: When running mstest against a WCF service, WcfSvcHost fails to run and tests fail. Tests pass when debugged
body: <p>Using Visual Studio 2010, I have written a simple WCF service and some integration tests that I want to run against it. I build my proxy for the tests at runtime in code rather than using configuration.</p>
  
  <p>My tests pass in debug but not when run!</p>
  
  <p><strong>FAIL if run</strong>  - go Test/Run/Tests in current context ( as the WCF Service it calls has not been hosted)</p>
  
  <p><strong>PASS in debug</strong> - go Test/Debug/Tests in current context ( as the WCF project has WCF Options/Start WCF Service Host when debugging another project in the same solution)</p>
  
  <p>Is there a way to get WCFServiceHost to start when the tests are run normally?</p>
  
  <p>Thanks,
  Andy</p>
  
  <pre><code>Test method BulkLoaderIntegrationTests.IntegrationTests.ImportEntries_withGoodPCMs_reportsCreatedOk threw exception: 
      System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://localhost:8001/OLELoader. The connection attempt lasted for a time span of 00:00:00.9687686. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8001.  ---&gt; System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8001
  </code></pre>