liveBook · Manning

HostBuilder

As explained in .NET MAUI in Action

A host builder is a .NET hosting configuration object that constructs and configures an application host.

A HostBuilder is the configuration object behind a .NET MAUI application's startup flow. MauiProgram.CreateMauiApp creates it, configures the application, and builds the MauiApp that runs the app. section 2.3

A typical startup sequence is:

  • Register the application with UseMauiApp<App>(). section 2.3

MauiProgram.cs

var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .ConfigureFonts(fonts => { /* font registrations */ }); return builder.Build();

How .NET MAUI in Action covers it

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 it assumes
Assumes basic C# methods and types while contrasting MAUI startup with the conventional Main entry point.
What you can do after
Build and configure a .NET MAUI application host from MauiProgram.CreateMauiApp.
How it connects
Connects MauiApp, CreateMauiApp, UseMauiApp, App, and application startup.

Also explained in

Compare how 2 books explain HostBuilder →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.