WebApplication
The ASP.NET Core host object that owns configuration, services and the middleware pipeline, created by WebApplication.CreateBuilder(args) and started with app.Run().
In more detail
The builder loads configuration and collects service registrations; builder.Build() creates the app, on which you add middleware and map endpoints. The host validates options and starts the server before accepting requests.
Example
var builder = WebApplication.CreateBuilder(args);Related terms
- Program.cs — The source file where a .NET application starts, usually holding top-level statements that build and run the host.
- IServiceCollection — The list of service registrations the dependency injection container is built from, reached in ASP.NET Core as builder.Services.
- middleware pipeline — The ordered chain of middleware every HTTP request passes through on the way in, and in reverse on the way out.
- Kestrel — The cross-platform web server built into ASP.NET Core that listens for HTTP requests and hands them to your application.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices
- The ASP.NET Core Middleware Pipeline — Modern .NET Core, C# & Enterprise Microservices
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices