title: Azure Pipeline - launch server inside test application
body: <p>I have a XUnit project, that when starting up initializes a server in the class constructor:</p>
  <pre><code>public OPCUASampleServerTest(OPCTagList oPCTagList)
  {
      MySampleServer server = new(true, 3600, null);
      this.thread = new Thread(() =&gt; server.Run());
      this.thread.Start();
      this._taglist = oPCTagList.Taglist;
  }
  </code></pre>
  <p>The tests utilizing the server, communicates to it via <code>localhost</code> and all works fine on my machine. I have also tested it by cloning the code to assure that everything is present in the repository. Everything compiles as expected. I am trying to have the same result on an Azure pipeline. I have a working pipeline that builds and runs the initial test cases, WITHOUT the server. Now after adding this <code>OPCUASampleServerTest</code> the test fails on the server, but not on my machine. The error is that it is not able to connect to the server</p>
  <pre><code>OPCUAClass opc = new(&quot;localhost&quot;, &quot;51210&quot;, this._taglist, 300, false);
  bool connected = opc.InitializeOPCUAClient(); //returns false on server, and true on running it on my own machine
  </code></pre>
  <p>I am therefore thinking that the issue is that it cannot see/connect to <code>localhost</code>. Is there some specific setting I am missing in my test function in the pipeline that looks like this:</p>
  <pre><code>- task: DotNetCoreCLI@2
    displayName: Test xUnit
    inputs:
      command: test
      projects: '**/OPCDLL.Test.csproj'
      arguments: '--configuration $(buildConfiguration) --collect &quot;Code coverage&quot; --no-build'
      testRunTitle: 'Generic Repository Tests'
      publishTestResults: true
  </code></pre>
  <p>Running what I interpret as the same function using the dotnet CLI:</p>
  <pre><code>dotnet test OPCDLL.Test.csproj  --configuration Release --collect &quot;Code coverage&quot; --no-build --framework net5.0
  </code></pre>
  <p>I get 4 passed tests, as it should be. So there is definitely something spurious in the azure run?</p>