Table of Contents

Namespace Codebelt.Bootstrapper.Console

The Codebelt.Bootstrapper.Console namespace delivers the console-specific implementation of the Codebelt bootstrapper, including ConsoleProgram<TStartup>/ConsoleStartup for the conventional Program/Startup pair and MinimalConsoleProgram for the minimal-host model.

Use it when the host is a console application — a long-running daemon, a cron-style job, or a CLI process — and you want the BootstrapperLifetime callbacks (OnApplicationStartedCallback, OnApplicationStoppingCallback, OnApplicationStoppedCallback) to surface in your Startup so you can log and tear down cleanly. The minimal variant reflects over the entry assembly to discover a concrete MinimalConsoleProgram type, so the project keeps a clean Program.cs while still hosting a real application model.

If you are starting a new console application, start with MinimalConsoleProgram and its CreateHostBuilder helper — it composes UseBootstrapperLifetime, UseBootstrapperEnvironmentDefaults, UseBootstrapperProgram, and UseMinimalConsoleProgram in one call. If you are keeping the conventional Program.cs/Startup.cs split, start with ConsoleProgram<TStartup> and pair it with ConsoleStartup to register services and override RunAsync.

Availability: .NET 10 and .NET 9

Extension Members

Type Ext Methods
HostApplicationBuilder ⬇️ UseBootstrapperProgram, UseMinimalConsoleProgram
IHostBuilder ⬇️ UseConsoleStartup<TStartup>

Classes

ConsoleHostedService<TStartup>

Provides a console application that is managed by its host.

ConsoleProgram<TStartup>

The base entry point of an application responsible for registering its ConsoleStartup partner.

ConsoleStartup

Provides the base class of a conventional based Startup class for a console application.

HostApplicationBuilderExtensions

Extension methods for the IHostApplicationBuilder.

HostBuilderExtensions

Extension methods for the IHostBuilder.

MinimalConsoleHostedService

Provides a console application that is managed by its host.

MinimalConsoleProgram

The base entry point of an application optimized for console applications.

MinimalConsoleProgram<TProgram>

The base entry point of an application optimized for console applications with a specific bootstrap type.

ProgramFactory

The default implementation of IProgramFactory.

Interfaces

IProgramFactory

Provides an interface for initializing services and middleware used by an application.