title: Trying to understand CreateDefaultBuilder
body: <p>I am a newbie to writing C# Api, and am looking at IdentityServer4 QuickStart1
  I see that the QuickstartIdentityServer module has </p>
  
  <pre><code>using System;
  using Microsoft.AspNetCore;
  using Microsoft.AspNetCore.Hosting;
  
  namespace QuickstartIdentityServer
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              Console.Title = "IdentityServer";
  
              BuildWebHost(args).Run();
          }
  
          public static IWebHost BuildWebHost(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;()
                  .Build();
      }
  }
  </code></pre>
  
  <p>And the API has</p>
  
  <pre><code>using System;
  using Microsoft.AspNetCore;
  using Microsoft.AspNetCore.Hosting;
  
  namespace Api
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              Console.Title = "API";
  
              BuildWebHost(args).Run();
          }
  
          public static IWebHost BuildWebHost(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;()
                  .Build();
      }
  }
  </code></pre>
  
  <p>I am having problems understanding what BuildWebHost actually does and why I need it to be running in 2 separate processes before I can use my client process to connect to the API</p>
  
  <p>I see that BuildWebHost contains </p>
  
  <pre><code>WebHost.CreateDefaultBuilder
  </code></pre>
  
  <p>Looking at  Microsoft.AspNetCore (from metadata)  I see that it is a static class that contains the declaration of a method </p>
  
  <pre><code>public static IWebHostBuilder CreateDefaultBuilder(string[] args);
  </code></pre>
  
  <p>So the actual code for the method must be in Microsoft.AspNetCore.Dll</p>
  
  <p>Why does it need to run both in IdentityServer4 and the Api ?</p>