HostApplicationBuilder Class

Definition

A builder for hosted applications and services that helps manage configuration, logging, lifetime, and more.

public ref class HostApplicationBuilder sealed
public sealed class HostApplicationBuilder
type HostApplicationBuilder = class
Public NotInheritable Class HostApplicationBuilder
Inheritance
HostApplicationBuilder

Constructors

HostApplicationBuilder()

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

HostApplicationBuilder(HostApplicationBuilderSettings)

Initializes a new instance of the HostApplicationBuilder class.

HostApplicationBuilder(String[])

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

Properties

Configuration

Gets a collection of services for the application to compose. This property is useful for adding user-provided or framework-provided services.

Environment

Gets information about the hosting environment an application is running in.

Logging

Gets a collection of logging providers for the application to compose. This property is useful for adding new logging providers.

Services

Gets a collection of services for the application to compose. This property is useful for adding user-provided or framework-provided services.

Methods

Build()

Builds the host. This method can only be called once.

ConfigureContainer<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>, Action<TContainerBuilder>)

Registers a IServiceProviderFactory<TContainerBuilder> instance to be used to create the IServiceProvider.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to