public class Program
{
    public static void Main(string[] args)
    {
        BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .Build();
}
  1. Configures Kestrel as the web server.
  2. Sets the content root to the path returned by Directory.GetCurrentDirectory.
  3. Loads optional configuration from:
  4. Configures logging for console and debug output.
  5. When running behind IIS, enables IIS integration.
  6. Sets ServiceProviderOptions.ValidateScopes to true if the app's environment is Development.

Web Server Implementations

Kestrel