GenericHostBuilderExtensions.ConfigureWebHostDefaults(IHostBuilder, Action<IWebHostBuilder>) Method

Definition

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureWebHostDefaults(Microsoft::Extensions::Hosting::IHostBuilder ^ builder, Action<Microsoft::AspNetCore::Hosting::IWebHostBuilder ^> ^ configure);
public static Microsoft.Extensions.Hosting.IHostBuilder ConfigureWebHostDefaults (this Microsoft.Extensions.Hosting.IHostBuilder builder, Action<Microsoft.AspNetCore.Hosting.IWebHostBuilder> configure);
static member ConfigureWebHostDefaults : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.AspNetCore.Hosting.IWebHostBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function ConfigureWebHostDefaults (builder As IHostBuilder, configure As Action(Of IWebHostBuilder)) As IHostBuilder

Parameters

builder
IHostBuilder

The IHostBuilder instance to configure

configure
Action<IWebHostBuilder>

The configure callback

Returns

IHostBuilder

The IHostBuilder for chaining.

Remarks

The following defaults are applied to the IWebHostBuilder: use Kestrel as the web server and configure it using the application's configuration providers, adds the HostFiltering middleware, adds the ForwardedHeaders middleware if ASPNETCORE_FORWARDEDHEADERS_ENABLED=true, and enable IIS integration.

Applies to