HostBuilderContext Class

Definition

Context containing the common services on the IHost. Some properties may be null until set by the IHost.

C#
public class HostBuilderContext
Inheritance
HostBuilderContext

Constructors

Properties

Configuration

The IConfiguration containing the merged configuration of the application and the IHost.

HostingEnvironment

The IHostEnvironment initialized by the IHost.

Properties

A central location for sharing state between components during the host building process.

Applies to

Product Versions
.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)