Table of Contents

Class HostBuilder

Namespace
nanoFramework.Hosting
Assembly
nanoFramework.Hosting.dll

Default implementation of IHostBuilder.

public class HostBuilder : IHostBuilder
Inheritance
HostBuilder
Implements
Inherited Members
Extension Methods

Constructors

HostBuilder()

Initializes a new instance of HostBuilder.

public HostBuilder()

Properties

Properties

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

public object[] Properties { get; set; }

Property Value

object[]

Methods

Build()

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

public 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.

public 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.

public 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.