WebHost.CreateDefaultBuilder WebHost.CreateDefaultBuilder WebHost.CreateDefaultBuilder WebHost.CreateDefaultBuilder Method

Definition

Overloads

CreateDefaultBuilder() CreateDefaultBuilder() CreateDefaultBuilder() CreateDefaultBuilder()

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults using typed Startup.

CreateDefaultBuilder() CreateDefaultBuilder() CreateDefaultBuilder() CreateDefaultBuilder()

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

public:
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ CreateDefaultBuilder();
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder CreateDefaultBuilder ();
static member CreateDefaultBuilder : unit -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
Public Shared Function CreateDefaultBuilder () As IWebHostBuilder

Returns

Remarks

The following defaults are applied to the returned WebHostBuilder: use Kestrel as the web server and configure it using the application's configuration providers, set the Microsoft.Extensions.Hosting.IHostEnvironment.ContentRootPath to the result of GetCurrentDirectory(), load IConfiguration from 'appsettings.json' and 'appsettings.[Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName].json', load IConfiguration from User Secrets when Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName is 'Development' using the entry assembly, load IConfiguration from environment variables, configure the Microsoft.Extensions.Logging.ILoggerFactory to log to the console and debug output, adds the HostFiltering middleware, adds the ForwardedHeaders middleware if ASPNETCORE_FORWARDEDHEADERS_ENABLED=true, and enable IIS integration.

CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[]) CreateDefaultBuilder(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

public:
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ CreateDefaultBuilder(cli::array <System::String ^> ^ args);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder CreateDefaultBuilder (string[] args);
static member CreateDefaultBuilder : string[] -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
Public Shared Function CreateDefaultBuilder (args As String()) As IWebHostBuilder

Parameters

args
String[]

The command line args.

Returns

Remarks

The following defaults are applied to the returned WebHostBuilder: use Kestrel as the web server and configure it using the application's configuration providers, set the Microsoft.Extensions.Hosting.IHostEnvironment.ContentRootPath to the result of GetCurrentDirectory(), load IConfiguration from 'appsettings.json' and 'appsettings.[Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName].json', load IConfiguration from User Secrets when Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName is 'Development' using the entry assembly, load IConfiguration from environment variables, load IConfiguration from supplied command line args, configure the Microsoft.Extensions.Logging.ILoggerFactory to log to the console and debug output, adds the HostFiltering middleware, adds the ForwardedHeaders middleware if ASPNETCORE_FORWARDEDHEADERS_ENABLED=true, and enable IIS integration.

CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[]) CreateDefaultBuilder<TStartup>(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults using typed Startup.

public:
generic <typename TStartup>
 where TStartup : class static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ CreateDefaultBuilder(cli::array <System::String ^> ^ args);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder CreateDefaultBuilder<TStartup> (string[] args) where TStartup : class;
static member CreateDefaultBuilder : string[] -> Microsoft.AspNetCore.Hosting.IWebHostBuilder (requires 'Startup : null)
Public Shared Function CreateDefaultBuilder(Of TStartup As Class) (args As String()) As IWebHostBuilder

Type Parameters

TStartup

The type containing the startup methods for the application.

Parameters

args
String[]

The command line args.

Returns

Remarks

The following defaults are applied to the returned WebHostBuilder: use Kestrel as the web server and configure it using the application's configuration providers, set the Microsoft.Extensions.Hosting.IHostEnvironment.ContentRootPath to the result of GetCurrentDirectory(), load IConfiguration from 'appsettings.json' and 'appsettings.[Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName].json', load IConfiguration from User Secrets when Microsoft.Extensions.Hosting.IHostEnvironment.EnvironmentName is 'Development' using the entry assembly, load IConfiguration from environment variables, load IConfiguration from supplied command line args, configure the Microsoft.Extensions.Logging.ILoggerFactory to log to the console and debug output, enable IIS integration.

Applies to