ASP.NET Core is Microsoft’s open-source, cross-platform web framework for building server-side web applications, HTTP APIs and real-time services on the .NET runtime. In web architecture, it occupies the backend layer: it receives HTTP requests, runs them through a configurable middleware pipeline, executes application code and returns HTML, JSON or streamed responses.
The framework was released in 2016 as a ground-up redesign of the older Windows-only ASP.NET. It runs on Windows, Linux and macOS, ships with its own high-performance web server called Kestrel, and follows the yearly .NET release cadence, with long-term support (LTS) releases every second year.
How the ASP.NET Core request pipeline works
Every ASP.NET Core application is built around a host that configures services, logging and the server, and a request pipeline that processes each incoming request in sequence. The pipeline is composed of middleware components, small units that can inspect the request, act on it, call the next component or short-circuit the chain and respond immediately.
Order matters because each middleware wraps the ones registered after it. Exception handling must come first so that it can catch failures downstream, while authentication must run before authorization, and both must precede the endpoint that serves protected data. A misordered pipeline is one of the most common causes of security gaps and confusing behavior.
The following table lists the main building blocks that a request passes through in a typical deployment.
| Component | Role | Typical configuration |
|---|---|---|
| Kestrel | Cross-platform HTTP server inside the process | HTTP/1.1, HTTP/2, HTTP/3, TLS |
| Reverse proxy | Optional front server for TLS, load balancing, caching | Nginx, IIS, YARP, cloud load balancer |
| Middleware | Ordered handlers for cross-cutting concerns | Exceptions, HTTPS, static files, CORS, auth |
| Routing | Maps URL and HTTP method to an endpoint | Attribute or pattern-based routes |
| Endpoint | Executes the application logic | Controller action, Razor Page, minimal API handler |
| Dependency injection container | Creates and disposes services | Singleton, scoped or transient lifetimes |
Dependency injection is built into the framework rather than added by a library. Services are registered with a lifetime: singleton for one shared instance, scoped for one instance per request and transient for a new instance on every resolution. Injecting a scoped service such as a database context into a singleton is a classic error, because the singleton then holds a stale object across requests.
Programming models in ASP.NET Core
ASP.NET Core offers several programming models on one shared foundation, so teams can mix them inside a single application. All of them use the same routing, middleware, configuration and dependency injection, which keeps cross-cutting behavior consistent.
| Model | Output | Best suited for |
|---|---|---|
| Minimal APIs | JSON over HTTP | Small services, microservices, lean endpoints |
| MVC controllers | JSON or server-rendered views | Large APIs with filters and conventions |
| Razor Pages | Server-rendered HTML per page | Form-heavy sites and admin tools |
| Blazor | Interactive components in C# | Rich interfaces without a JavaScript framework |
| SignalR | Real-time messages over WebSockets | Chat, dashboards, live notifications |
| gRPC | Binary Protocol Buffers over HTTP/2 | Fast service-to-service communication |
Blazor deserves a note because it blurs the line between frontend and backend. Components can render on the server, run in the browser through WebAssembly, or combine both modes, which lets a C# team build interactive pages while sharing validation and data types with the API layer.
How ASP.NET Core compares with other web frameworks
ASP.NET Core belongs to the same category as Spring Framework, Django, Express.js and Ruby on Rails: a server-side web framework that structures how requests are handled. The differences lie in the language, the runtime model and how much functionality comes built in.
| Framework | Language and runtime | Concurrency model | Built-in scope |
|---|---|---|---|
| ASP.NET Core | C# on .NET | Async tasks on a thread pool | Broad: DI, auth, validation, real time |
| Spring Framework | Java or Kotlin on the JVM | Thread per request or reactive | Broad, modular ecosystem |
| Express.js | JavaScript on Node.js | Single-threaded event loop | Minimal, relies on packages |
| Django | Python | Worker processes, optional async | Broad, includes ORM and admin |
| Ruby on Rails | Ruby | Worker processes and threads | Broad, convention over configuration |
The async and await model is central to its performance. While a request waits for a database or a remote API, the thread returns to the pool and serves other work, so a modest server can handle thousands of concurrent connections. Independent benchmarks such as TechEmpower regularly place ASP.NET Core among the faster mainstream frameworks, although real applications are usually limited by database access rather than by the framework itself.
Deploying and configuring ASP.NET Core applications
An ASP.NET Core application compiles into a self-contained or framework-dependent deployment that can run as a console process, a Windows service, a Linux systemd unit or a container image. Official .NET container images and the ability to publish trimmed, ahead-of-time (AOT) compiled binaries make it well suited to cloud-native and twelve-factor app designs.
Configuration is layered: values from appsettings.json are overridden by environment-specific files, environment variables, command-line arguments and secret stores. This order lets the same build move unchanged from development to staging and production. The decision table below summarizes common hosting choices.
| Situation | Recommended setup | Reason |
|---|---|---|
| Containerized microservices | Kestrel in a container behind an ingress | Portable, scales horizontally |
| Existing Windows server estate | IIS with the ASP.NET Core module | Uses existing management and certificates |
| Linux virtual machine | Kestrel behind Nginx as reverse proxy | TLS offload and static file caching |
| Fast cold start required | Native AOT publish of a minimal API | Smaller image, lower startup time |
| Managed platform | Cloud app service or serverless container | Patching and scaling handled by the provider |
Limitations and common mistakes with ASP.NET Core
ASP.NET Core is mature, but its breadth creates typical pitfalls that experienced developers learn to avoid. Most problems come from misunderstanding asynchronous code, service lifetimes or the release model rather than from defects in the framework.
- Blocking on async code with .Result or .Wait() can exhaust the thread pool and cause request queuing under load.
- Misordered middleware can leave endpoints unprotected or skip error handling entirely.
- Ignoring the support lifecycle is risky: standard-term releases receive about 18 months of patches, LTS releases about three years.
- Native AOT has restrictions: reflection-heavy libraries and some MVC features are not fully supported.
- Assuming it is the old ASP.NET leads to errors, because Web Forms and the System.Web model do not exist in ASP.NET Core.
The framework also brings a learning curve for teams coming from dynamic languages, since strong typing, dependency injection and the hosting model require more upfront structure than a minimal Express.js or Flask application.
Explained without jargon
When you open a website or an app talks to a server, something on that server has to read the request and decide what to send back. ASP.NET Core is a toolkit for building that something. Programmers write the rules in the C# language, and the toolkit handles the routine work of receiving requests, checking who is asking and sending answers.
Think of it as the kitchen of a restaurant. Orders arrive, pass through stations in a fixed order, such as checking the order, preparing the dish and plating it, and the finished meal goes out. ASP.NET Core provides the kitchen layout and the equipment, while each company decides what is on its menu.
A typical use case
A regional logistics company needs a backend for its customer portal and its drivers’ mobile app. The development team builds one ASP.NET Core service with minimal API endpoints for shipment tracking, SignalR to push live delivery positions to the portal, and JWT bearer authentication shared by the web and mobile clients.
The service is packaged as a Linux container image and deployed to a Kubernetes cluster with three replicas behind an ingress controller. Configuration such as database connection strings comes from environment variables and a secret store, so the same image runs in staging and production.
During the holiday peak, traffic triples to roughly 2,000 requests per second. Because the database calls are fully asynchronous, the cluster scales from three to eight replicas automatically and median response time stays below 80 milliseconds, without any change to the application code.