WebApplication.CreateBuilder Method

Definition

Overloads

CreateBuilder()

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

CreateBuilder(WebApplicationOptions)

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

CreateBuilder(String[])

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

CreateBuilder()

Source:
WebApplication.cs

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

C#
public static Microsoft.AspNetCore.Builder.WebApplicationBuilder CreateBuilder ();

Returns

The WebApplicationBuilder.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

CreateBuilder(WebApplicationOptions)

Source:
WebApplication.cs

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

C#
public static Microsoft.AspNetCore.Builder.WebApplicationBuilder CreateBuilder (Microsoft.AspNetCore.Builder.WebApplicationOptions options);

Parameters

Returns

The WebApplicationBuilder.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

CreateBuilder(String[])

Source:
WebApplication.cs

Initializes a new instance of the WebApplicationBuilder class with preconfigured defaults.

C#
public static Microsoft.AspNetCore.Builder.WebApplicationBuilder CreateBuilder (string[] args);

Parameters

args
String[]

The command line arguments.

Returns

The WebApplicationBuilder.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0