HostBuilder
HostBuilder is a .NET hosting API type that configures and constructs an application host.
ASP.NET Core in Action, 3e
HostBuilder is a .NET hosting API type that configures application services, hosting, configuration, and middleware before creating an application host.
- How it is used
- Configures application hosting, services, configuration, logging, middleware, and endpoints before creating a runnable host.
- How deep it goes
- Explains default setup, customization points, and Build()/Run() lifecycle, while deferring implementation details behind framework helpers.
- Examples
- Uses default-builder customization, Startup wiring, and an in-memory TestServer integration test with HttpClient.
- What you can do after
- Build it from scratch or customize defaults, then run an application host or exercise a web pipeline in memory.
.NET MAUI in Action
A host builder is a .NET hosting configuration object that constructs and configures an application host.
- How it is used
- Configures the .NET MAUI startup pipeline before launching the application.
- How deep it goes
- Explains builder creation, extension-method configuration, and Build(), but does not descend into host internals.
- Examples
- Uses MauiProgram.cs with UseMauiApp<App>(), ConfigureFonts, and Build().
- What you can do after
- Build and configure a .NET MAUI application host from MauiProgram.CreateMauiApp.
Related concepts
- MauiAppproduces · MauiApp is the .NET MAUI application object produced by application startup configuration.
- MAUIused by · .NET MAUI is a cross-platform .NET framework for building native applications and user interfaces from a shared codebase.
- Microsoft.AspNetCore.TestHostused by · Microsoft.AspNetCore.TestHost is an ASP.NET Core library that hosts applications in memory for integration testing without a separate server.
- Host.CreateDefaultBuilder()produced by · Host.CreateDefaultBuilder() is a .NET factory method that creates an application host builder with default configuration, logging, environment, and dependency-injection settings.
- IServiceCollectionuses · IServiceCollection is a .NET interface representing service descriptors and registrations used to configure a dependency-injection container.
- dependency injection containeruses · A dependency injection container is software that constructs and resolves objects by supplying their configured dependencies, often managing their lifetimes.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

