Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
C# and .NET Basics  ›  Lesson

.NET — The Platform Underneath

.NET 12 min.NET is the runtime, base libraries and SDK that compile C# into intermediate code and run it on Windows, macOS and Linux.

.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 dotnet command 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.

ReadingRoom from laptop to serverStep 1 of 4
  1. Write

    You edit Program.cs on 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.

quick drill

What does the C# compiler produce?

quick drill

Which part of .NET cleans up objects you no longer use?

quick drill

A production server only runs ReadingRoom and never builds it. What does it need?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainSDK or runtime?

ReadingRoom is built on your laptop and then deployed to a Linux server. Explain what happens to the C# code between your editor and the running server, and which of the SDK and the runtime each machine needs.