title: Trying to get a NUnit test suite to bring up the ASP.NET server on localhost before the first test doesn't work
body: <p>I've made a minimal reproduction of the problem I have here - <a href="https://github.com/paul-hammant/dotnet_build_snafu" rel="nofollow noreferrer">https://github.com/paul-hammant/dotnet_build_snafu</a>.</p>
  <p>This .NET 6.0 project has a build that should compile then launch tests under NUnit Control, like so:</p>
  <ol>
  <li>Bring up service on a localhost HTTP port.</li>
  <li>Launch WebDriver to GET the main page then assert on the page title.</li>
  </ol>
  <p>The server doesn't come up. The NUnit [OneTimeSetUp] is executed first, but all the code that should start the server isn't doing so.</p>
  <p>The same <strong>shared</strong> code executes from the Main() method for a non-test launch of app works just fine. Thus I'm confused.  Even if I add a 10 second delay, it won't work with NUnit so it is not a timing issue.</p>
  <p>The crucial snippet of the shared code <a href="https://github.com/paul-hammant/dotnet_build_snafu/blob/main/DotNetPoC/DotNetPoCStartup.cs#L42" rel="nofollow noreferrer">from here</a> is:</p>
  <pre><code>app.UseHttpsRedirection();
  
  app.UseRouting();
          
  app.UseAuthorization();
  
  app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllers();
      endpoints.MapControllerRoute(
                  name: &quot;default&quot;,
                  pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  });
  </code></pre>
  <p>The GitHub code is cloneable and buildable.  I can reproduce the same problem on Mac and Windows.</p>