Host.CreateDefaultBuilder Method

Definition

Overloads

CreateDefaultBuilder()

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

CreateDefaultBuilder(String[])

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

CreateDefaultBuilder()

Source:
Host.cs
Source:
Host.cs
Source:
Host.cs

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

public static Microsoft.Extensions.Hosting.IHostBuilder CreateDefaultBuilder ();

Returns

The initialized IHostBuilder.

Remarks

The following defaults are applied to the returned HostBuilder:

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

CreateDefaultBuilder(String[])

Source:
Host.cs
Source:
Host.cs
Source:
Host.cs

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

public static Microsoft.Extensions.Hosting.IHostBuilder CreateDefaultBuilder (string[]? args);

Parameters

args
String[]

The command line args.

Returns

The initialized IHostBuilder.

Remarks

The following defaults are applied to the returned HostBuilder:

Applies to

.NET 9 (package-provided) e outras versões
Produto Versões
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)