What are .NET and ASP.NET Core?
Before writing any code it helps to know what you are building on. This lesson explains what .NET is, what ASP.NET Core adds on top of it, and which ASP.NET Core style (MVC, Razor Pages, Blazor or APIs) fits which job.
- Your MVC appControllers, views, models and your own C# code
- ASP.NET CoreWeb framework: Kestrel server, middleware, routing, MVC, Razor
- .NET runtime and librariesRuns compiled C# code, manages memory, provides base classes
- Operating systemWindows, Linux or macOS, on a laptop, server, container or cloud
Each layer builds on the one below it. You write the top layer; Microsoft maintains the rest as free, open-source software.
The idea in plain words
.NET is a free, open-source platform for building and running applications. It includes a runtime that executes your code, a large set of ready-made libraries (for files, text, dates, networking and much more), languages such as C#, and the SDK, a set of command-line tools to create, build and run projects.
ASP.NET Core is the part of .NET for building web apps and web APIs. It gives you a fast web server called Kestrel, a request pipeline, routing, security features and several ways to build user interfaces. It runs on Windows, Linux and macOS, so the same app can run on your laptop and on a Linux server or container.
Ways to build web apps with ASP.NET Core
All of these share the same foundation, so skills carry over between them. This course focuses on MVC because it teaches the clearest separation between request handling, data and HTML.
- MVC: controllers handle requests and Razor views render HTML. Good for structured, page-based sites.
- Razor Pages: each page has its own handler class. Good for simpler page-focused apps.
- Blazor: interactive web UI written in C# components.
- Web API and Minimal APIs: return JSON for mobile apps, SPAs and other services.
Example: the smallest ASP.NET Core app
Check that the .NET SDK is installed by running dotnet --version in a terminal. Then look at how little code a working web app needs. This app answers every request to the root URL with a line of text. An MVC app adds controllers and views on top of exactly this kind of startup code.
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello, ASP.NET Core!");
app.Run();Common mistakes
Beginners often mix up names that sound alike.
- Confusing .NET Framework with .NET. .NET Framework is the older, Windows-only platform. New projects use .NET (once called .NET Core).
- Confusing ASP.NET (the old framework with Web Forms and System.Web) with ASP.NET Core, which is a full rewrite.
- Picking a release without checking its support. Long Term Support (LTS) releases are supported for longer, which suits production apps.
Interview question
What is the difference between .NET Framework and .NET (formerly .NET Core)?
.NET Framework is the original Windows-only implementation and only receives maintenance fixes. .NET is the modern, open-source, cross-platform successor: it runs on Windows, Linux and macOS, is faster, supports side-by-side versions and containers, and is where all new features go. ASP.NET Core runs on modern .NET.
Want the full details? Read the official Microsoft documentation for this topic.