WebHostBuilderKestrelExtensions.ConfigureKestrel Method

Definition

Overloads

ConfigureKestrel(IWebHostBuilder, Action<WebHostBuilderContext,KestrelServerOptions>)

Configures Kestrel options but does not register an IServer. See UseKestrel(IWebHostBuilder).

ConfigureKestrel(IWebHostBuilder, Action<KestrelServerOptions>)

Configures Kestrel options but does not register an IServer. See UseKestrel(IWebHostBuilder).

ConfigureKestrel(IWebHostBuilder, Action<WebHostBuilderContext,KestrelServerOptions>)

Source:
WebHostBuilderKestrelExtensions.cs
Source:
WebHostBuilderKestrelExtensions.cs

Configures Kestrel options but does not register an IServer. See UseKestrel(IWebHostBuilder).

C#
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder ConfigureKestrel (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Action<Microsoft.AspNetCore.Hosting.WebHostBuilderContext,Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions> configureOptions);

Parameters

hostBuilder
IWebHostBuilder

The Microsoft.AspNetCore.Hosting.IWebHostBuilder to configure.

configureOptions
Action<WebHostBuilderContext,KestrelServerOptions>

A callback to configure Kestrel options.

Returns

The Microsoft.AspNetCore.Hosting.IWebHostBuilder.

Applies to

ASP.NET Core 9.0 والإصدارات الأخرى
منتج الإصدارات
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ConfigureKestrel(IWebHostBuilder, Action<KestrelServerOptions>)

Source:
WebHostBuilderKestrelExtensions.cs
Source:
WebHostBuilderKestrelExtensions.cs

Configures Kestrel options but does not register an IServer. See UseKestrel(IWebHostBuilder).

C#
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder ConfigureKestrel (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Action<Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions> options);

Parameters

hostBuilder
IWebHostBuilder

The Microsoft.AspNetCore.Hosting.IWebHostBuilder to configure.

options
Action<KestrelServerOptions>

A callback to configure Kestrel options.

Returns

The Microsoft.AspNetCore.Hosting.IWebHostBuilder.

Applies to

ASP.NET Core 9.0 والإصدارات الأخرى
منتج الإصدارات
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0