public static void WebHostBuilder(WebHostBuilder webBuilder)
    {
        // <snippet_WebHostBuilderCaptureStartupErrors>
        webBuilder.CaptureStartupErrors(true);
        // </snippet_WebHostBuilderCaptureStartupErrors>

        // <snippet_WebHostBuilderDetailedErrors>
        webBuilder.UseSetting(WebHostDefaults.DetailedErrorsKey, "true");
        // </snippet_WebHostBuilderDetailedErrors>

        // <snippet_WebHostBuilderHostingStartupAssemblies>
        webBuilder.UseSetting(
            WebHostDefaults.HostingStartupAssembliesKey, "assembly1;assembly2");
        // </snippet_WebHostBuilderHostingStartupAssemblies>

        // <snippet_WebHostBuilderHostingStartupExcludeAssemblies>
        webBuilder.UseSetting(
            WebHostDefaults.HostingStartupExcludeAssembliesKey, "assembly1;assembly2");
        // </snippet_WebHostBuilderHostingStartupExcludeAssemblies>

        // <snippet_WebHostBuilderHttpsPort>
        webBuilder.UseSetting("https_port", "8080");
        // </snippet_WebHostBuilderHttpsPort>

        // <snippet_WebHostBuilderPreferHostingUrls>
        webBuilder.PreferHostingUrls(true);
        // </snippet_WebHostBuilderPreferHostingUrls>

        // <snippet_WebHostBuilderPreventHostingStartup>
        webBuilder.UseSetting(WebHostDefaults.PreventHostingStartupKey, "true");
        // </snippet_WebHostBuilderPreventHostingStartup>

        // <snippet_WebHostBuilderUseStartup>
        webBuilder.UseStartup("StartupAssemblyName");
        // </snippet_WebHostBuilderUseStartup>

        // <snippet_WebHostBuilderUseStartupGeneric>
        webBuilder.UseStartup <Startup>();
        // </snippet_WebHostBuilderUseStartupGeneric>

        // <snippet_WebHostBuilderSuppressStatusMessages>
        webBuilder.UseSetting(WebHostDefaults.SuppressStatusMessagesKey, "true");
        // </snippet_WebHostBuilderSuppressStatusMessages>

        // <snippet_WebHostBuilderUseUrls>
        webBuilder.UseUrls("http://*:5000;http://localhost:5001;https://hostname:5002");
        // </snippet_WebHostBuilderUseUrls>

        // <snippet_WebHostBuilderUseWebRoot>
        webBuilder.UseWebRoot("public");
        // </snippet_WebHostBuilderUseWebRoot>
    }