TExcelTAD
Home › ASP.NET Core › ASP.NET Core Intro

ASP.NET Core Intro

ASP.NET Core is Microsoft's open-source, cross-platform framework for building web applications in C#. With it you can write JSON web APIs, server-rendered websites, real-time apps and microservices that run on Windows, Linux and macOS — in a container, on a plain VM or in the cloud. This course covers ASP.NET Core 9, which ships with .NET 9.

What you can build

App type ASP.NET Core feature Typical use
HTTP / JSON APIs Minimal APIs or controllers Back ends for SPAs and mobile apps
Server-rendered pages MVC (controllers + Razor views) or Razor Pages Admin panels, content sites, forms
Interactive web UI in C# Blazor Rich UIs without writing JavaScript
Real-time SignalR Chat, live dashboards, notifications
RPC between services gRPC Fast service-to-service calls

All of them sit on the same foundation: a web server called Kestrel, a middleware pipeline that processes each request, dependency injection, configuration and logging. Learn that foundation once and every app type feels familiar.

The smallest possible app

Here is a complete ASP.NET Core application. It is the entire Program.cs file of a new project:

csharp
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/", () => "Hello from ASP.NET Core!");

app.Run();

Four lines: create a builder (where you register services), build the app, map a URL to a handler, and run the server. When you start it and send a request, you get the handler's return value back:

bash · try it yourself
$ curl -i localhost:5000/
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Thu, 16 Oct 2026 09:00:00 GMT
Server: Kestrel
Transfer-Encoding: chunked

Hello from ASP.NET Core!

Note: ASP.NET Core cannot run inside your browser, so terminal sessions like the one above are simulated — they show what a real ASP.NET Core 9 app prints. Throughout the course the app listens on http://localhost:5000. Wherever possible, lessons also rebuild the underlying idea in plain C# that you can run right here.

How a request is handled

At its heart, a web framework turns a request (method + path + headers + body) into a response (status code + headers + body). You can model that idea in a few lines of ordinary C#:

csharp · try it yourself
using System;
using System.Collections.Generic;

// A tiny "route table": method + path -> handler
var routes = new Dictionary<string, Func<string>>
{
    ["GET /"] = () => "Hello from ASP.NET Core!",
    ["GET /time"] = () => "It is always 09:00 in this demo",
};

string Handle(string method, string path)
{
    if (routes.TryGetValue(
quot;{method} {path}", out var handler)) return
quot;200 OK -> {handler()}"; return "404 Not Found"; } Console.WriteLine(Handle("GET", "/")); Console.WriteLine(Handle("GET", "/time")); Console.WriteLine(Handle("POST", "/")); Console.WriteLine(Handle("GET", "/missing"));
200 OK -> Hello from ASP.NET Core!
200 OK -> It is always 09:00 in this demo
404 Not Found
404 Not Found

ASP.NET Core does the same job, but with real HTTP parsing, a fast routing engine, typed parameters, JSON serialization, security and much more.

Why ASP.NET Core?

  • Performance — Kestrel is consistently among the fastest mainstream web servers in independent benchmarks.
  • One language end to end — C# for the API, the database layer (Entity Framework Core), background jobs and even the UI (Blazor).
  • Batteries included — DI, configuration, logging, validation, authentication, OpenAPI and health checks come in the box.
  • Cross-platform and open source — developed on GitHub, runs anywhere .NET runs.
  • Long-term support — even-numbered .NET versions (8, 10) are LTS releases supported for three years; odd versions such as .NET 9 are STS releases supported for two years.

ASP.NET vs ASP.NET Core

The old ASP.NET (System.Web, Web Forms) only ran on Windows with .NET Framework. ASP.NET Core is a complete rewrite from 2016: modular, cross-platform and much faster. Today when people say "ASP.NET" they usually mean ASP.NET Core.

What you need to know first

You should be comfortable with C#: classes, interfaces, generics, lambdas, async/await and LINQ. If any of these feel shaky, the C# course on this site covers them all.

Course map

Section Topics
Basics Projects, minimal APIs, routing, JSON, status codes, middleware, DI, configuration, logging
Building Web Apps MVC, Razor, validation, error handling, filters, Entity Framework Core
Production Auth, CORS, caching, background work, testing, health checks, deployment
Practice Exercises and a complete notes REST API

Test yourself

Which web server is built into ASP.NET Core and runs your app by default?

  1. IIS
  2. Apache
  3. Kestrel
  4. Nginx

In the minimal app, what does app.MapGet("/", ...) do?

  1. Starts the web server
  2. Connects GET requests for / to a handler
  3. Registers a service in DI
  4. Reads the configuration

Which statement about ASP.NET Core is true?

  1. It only runs on Windows
  2. It is a rewrite of ASP.NET that runs on Windows, Linux and macOS
  3. It requires .NET Framework 4.8
  4. It can only serve HTML pages