Routing middleware
Routing middleware is an ASP.NET Core request-pipeline component that matches incoming requests to endpoints and stores the selected endpoint for subsequent processing.
ASP.NET Core in Action, 3e
UseRouting is an ASP.NET Core extension method that adds routing middleware to a web application's request pipeline.
- How it is used
- Selects a registered endpoint for each matching request before endpoint middleware executes it.
- How deep it goes
- Explains two-stage request handling and middleware placement, but defers detailed Razor Page handler selection.
- Examples
- Uses a `MapGet` Hello World endpoint and a Razor Pages pipeline ordered around static files and authorization.
- What you can do after
- Operate/configure it with `UseRouting()` when explicit placement is needed, while leaving endpoint execution to endpoint middleware.
Read how ASP.NET Core in Action, 3e explains routing middleware →
Pro ASP.NET Core 7, Tenth Edition
Routing middleware is an ASP.NET Core request-pipeline component that matches requests to endpoints and stores the selected endpoint for later processing.
- How it is used
- Matches request paths to endpoints in the ASP.NET Core pipeline so a selected endpoint can handle the response.
- How deep it goes
- Works through registration, path patterns, route values, and endpoint inspection; describes route scoring without detailing its algorithm.
- Examples
- Uses `/routing`, `/capital/uk`, three-segment paths, and a middleware response reporting the selected endpoint.
- What you can do after
- Build it from scratch with `MapGet`, read captured route values, and inspect the selected endpoint from middleware.
Read how Pro ASP.NET Core 7, Tenth Edition explains routing middleware →
Related concepts
- request pipelineconfigures · A request pipeline is an ordered sequence of processing components through which HTTP requests and their responses pass in a web application.
- routinguses · Routing is the selection of a path, destination, or processing component to direct an item, request, or flow toward an intended endpoint.
- Razor Pagesuses · Razor Pages is an ASP.NET Core page-focused programming model in which independently addressable pages combine Razor markup with request-handling logic.
- url pathuses · A URL path is the hierarchical component of a URL that identifies a resource or route within its host.
- endpointuses · An endpoint is a network-accessible address or interface through which a service exposes a resource or operation and handles requests and responses.
- handleruses · A handler is a callable or software component that processes an event, request, message, or other input and performs associated processing.
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.

