title: What is the difference between Host and WebHost class in asp.net core
body: <p>I was trying to migrate the my application from asp.net core 2.1 to 3.0 and there come a first suggested change in program.cs for creation of host.</p>
  
  <p>asp.net core 2.1 program.cs</p>
  
  <pre><code>public static void Main(string[] args)
  {
      CreateWebHostBuilder(args).Build().Run();
  }
  
  public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
      WebHost.CreateDefaultBuilder(args)
          .UseStartup&lt;Startup&gt;();
  </code></pre>
  
  <p>asp.net core 3.0 program.cs</p>
  
  <pre><code>public static void Main(string[] args)
  {
      CreateHostBuilder(args).Build().Run();
  }
  
  public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
      Host.CreateDefaultBuilder(args)
          .ConfigureWebHostDefaults(webBuilder =&gt;
          {
              webBuilder.UseStartup&lt;Startup&gt;();
          });
  </code></pre>
  
  <p>I can see that in asp.net core 3.0 it is creating Host instead of WebHost and injecting WebHostBuilder while crating Host.</p>
  
  <p>But I don't have an clear idea here what is difference between Host and WebHost and why asp.net core 3.0 application does not allow to create WebHost?</p>