All topics / The ASP.NET Pipeline & Kestrel

The ASP.NET Pipeline & Kestrel

Learn what ASP.NET Core is actually built on: Kestrel the web server, the middleware pipeline and the request delegate, the host and its built-in dependency-injection container and configuration, and how minimal APIs and MVC are conveniences over endpoint routing. The plumbing under every .NET web app, made visible.

  1. What Kestrel & the Pipeline Are ASP.NET Core in three pieces — Kestrel the web server, the middleware pipeline every request flows through, and the host that wires it all together — and how Program.cs maps onto them.
  2. Kestrel: The Web Server Kestrel is the cross-platform server that owns the socket, speaks HTTP, and hands each request to your pipeline as an HttpContext. Configuring ports, and why a reverse proxy is a choice.
  3. The Middleware Pipeline How Kestrel feeds each request through an ordered onion of middleware — Use, Run, Map — why registration order is the law, and how short-circuiting serves or rejects requests early.
  4. The RequestDelegate Strip away the sugar and a whole ASP.NET Core app is one RequestDelegate. Middleware is a function that wraps the next delegate to make a new one — here's what that means.
  5. The Host, DI & Configuration How WebApplicationBuilder wires up the DI container, layered configuration, logging, and Kestrel before your app exists — plus the options pattern, environments, and the generic host running background work.
  6. How Minimal APIs & MVC Sit on Top The payoff: your minimal API delegates and MVC actions are endpoints, and endpoint routing matches a request to one (UseRouting) then runs it (the endpoint middleware). The conveniences map back onto the pipeline.
  7. Where to Go Next Pull the whole machine together — host, pipeline, RequestDelegate, Kestrel — then point your new X-ray vision at performance, the ecosystem (BackgroundService, health checks, OpenTelemetry, YARP), and the parallel under every web stack.