The ASP.NET Core request pipeline has evolved significantly since .NET 5 and earlier.
With .NET 6+, Microsoft introduced the Minimal Hosting Model, which changed how the web application pipeline is built, configured, and executed.
This article explains:
How the old pipeline worked
How the new pipeline works
Key differences
Why Microsoft changed it
Which model is better for modern applications
1️⃣ What Is the ASP.NET Core Pipeline?
The ASP.NET Core pipeline consists of middlewares that process every incoming HTTP request.
Each request flows through middleware components such as:
Routing
Authentication
Authorization
CORS
Exception Handling
MVC / Endpoints
The hosting model defines how this pipeline is built and executed.
2️⃣ OLD PIPELINE (.NET 2.0 – .NET 5)
The Startup + Program Model
Before .NET 6, the pipeline was created using two files:
1. Program.cs
Created the Host Builder:
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
2. Startup.cs
Defined Services + Middleware:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
📌 Old Pipeline Diagram
Program.cs
↓
CreateHostBuilder()
↓
ConfigureWebHostDefaults()
↓
Startup.cs loaded
↓
- ConfigureServices()
- Configure()
↓
Application Pipeline Prepared
↓
App Runs
Characteristics of the Old Model
✔ More structured
✔ Clearly separated responsibilities
✔ More verbose
✔ Required a lot of boilerplate
✔ Harder for beginners
3️⃣ NEW PIPELINE (.NET 6+)
The Minimal Hosting Model
.NET 6 unified everything into a single file: Program.cs
Example:
var builder = WebApplication.CreateBuilder(args);
// Services
builder.Services.AddControllers();
var app = builder.Build();
// Middleware
app.UseAuthorization();
app.MapControllers();
app.Run();
No Startup.cs, no CreateHostBuilder, no UseStartup.
📌 New Pipeline Diagram
Program.cs
↓
WebApplication.CreateBuilder()
↓
builder.Services (DI configured)
↓
builder.Build()
↓
app (middleware pipeline configured)
↓
app.Run()
Characteristics of the New Model
✔ Much simpler
✔ Minimal boilerplate
✔ Services + middleware in one place
✔ Supports Minimal APIs
✔ Easier for microservices and cloud apps
✔ Feels like Node.js, Express, and modern frameworks

Join the conversation! Your thoughts help the community grow.