.NET — The Platform Underneath
C# is the language; .NET is everything that makes it run. When ReadingRoom works on your Mac and then on a Linux server without a single change, that is .NET doing its job. Knowing its parts tells you what to install where.
The rule
C# compiles to IL; the .NET runtime turns IL into machine code.
.NET has three parts you meet every day:
- The runtime (the CLR) loads your program, manages memory with a garbage collector, and compiles code for the processor as it runs.
- The base class library gives you ready-made types:
List<T>,DateTime, file access, HTTP clients, JSON. - The SDK holds the compiler and the
dotnetcommand you use to create, build and test projects.
Your C# is compiled into intermediate language (IL) and stored in an assembly, a .dll file. IL is the same on every operating system. When the app starts, the runtime's just-in-time (JIT) compiler turns IL into native instructions for that machine.
ASP.NET Core is not a separate product you bolt on. It is a framework that ships with .NET, so a web project simply targets it:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>Releases arrive every November. Even-numbered versions (.NET 8, .NET 10) are long-term support releases; odd-numbered ones (.NET 9) get a shorter support window.
The shortcut
Ask one question of any machine: does it build, or does it only run? A machine that builds needs the SDK. A machine that only runs needs just the runtime — for a web app, the ASP.NET Core runtime.
Write
You edit
Program.cson a Mac. Nothing is compiled yet.
The trap: installing the full SDK on every server "just in case". It is bigger and adds tools a production box never uses. And if you publish self-contained, the runtime travels inside your app, so the server needs nothing at all.
Drills
Answer fast — trust the rule.
What does the C# compiler produce?
Which part of .NET cleans up objects you no longer use?
A production server only runs ReadingRoom and never builds it. What does it need?
Which release is a long-term support version?
Remember
- C# compiles to IL; the .NET runtime turns IL into machine code.
- Builds need the SDK; running needs only the runtime.
- Even-numbered releases are long-term support.
