Table of Contents

Interface IHostBuilder

Namespace
nanoFramework.Hosting
Assembly
nanoFramework.Hosting.dll

A program initialization abstraction.

public interface IHostBuilder
Extension Methods

Properties

Properties

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

object[] Properties { get; set; }

Property Value

object[]

Methods

Build()

Run the given actions to initialize the host. This can only be called once.

IHost Build()

Returns

IHost

An initialized IHost.

Exceptions

InvalidOperationException

"Build can only be called once."

ConfigureServices(ServiceContextDelegate)

Adds services to the container. This can be called multiple times and the results will be additive.

IHostBuilder ConfigureServices(ServiceContextDelegate configureDelegate)

Parameters

configureDelegate ServiceContextDelegate

The delegate for configuring the IServiceCollection that will be used to construct the IServiceProvider.

Returns

IHostBuilder

The same instance of the IHostBuilder for chaining.

UseDefaultServiceProvider(ProviderContextDelegate)

Specify the IServiceProvider to be the default one.

IHostBuilder UseDefaultServiceProvider(ProviderContextDelegate configureDelegate)

Parameters

configureDelegate ProviderContextDelegate

The delegate for configuring the ServiceProviderOptions that will be used to construct the IServiceProvider.

Returns

IHostBuilder

The same instance of the IHostBuilder for chaining.