title: IWebHost: Calling Run() vs RunAsync()
body: <p>When a new ASP.NET Core 2.0 project is created, the boilerplate <code>Main</code> method in the <code>Program</code> class looks something like this:</p>
  
  <pre><code>public static void Main(string[] args)
  {
      BuildWebHost(args).Run(); // BuildWebHost returns an IWebHost
  }
  </code></pre>
  
  <p>But since C# 7.1, the <code>Main</code> method can be an asynchronous method returning <code>Task</code> instead of <code>void</code>. This means it's much easier to call an async method inside <code>Main</code>.</p>
  
  <p>So the <code>RunAsync()</code> on <code>IWebHost</code> can be called inside <code>Main</code> instead of the <code>Run()</code> method. Something like this:</p>
  
  <pre><code>public static async Task Main(string[] args)
  {
      await BuildWebHost(args).RunAsync().ConfigureAwait(false);
  }
  </code></pre>
  
  <p><a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.iwebhost?view=aspnetcore-2.0" rel="noreferrer">According to the documentation</a>, the <code>Run</code> method:</p>
  
  <blockquote>
    <p>Runs a web application and block the calling thread until host shutdown.</p>
  </blockquote>
  
  <p>Whereas the <code>RunAsync</code> method:</p>
  
  <blockquote>
    <p>Runs a web application and returns a Task that only completes when the token is triggered or shutdown is triggered.</p>
  </blockquote>
  
  <p>I was wondering when should the <code>RunAsync</code> method be used instead of the regular <code>Run</code> method? What are the practical implications of this? Would the end-user notice any difference?</p>