skipnothing/.NET Platform
UNIT 01

The .NET Runtime

How your code actually runs

No C# code in this unit, it's about what happens after you hit Build. Understanding this makes everything else in .NET click.

Loading…
TOPICS
#1

What is .NET

Read `dotnet --info` and decode every version number to the layer it reports on, pick SDK or runtime-only for a given machine role, and place a .NET version on the LTS/STS support timeline.

Run `dotnet --info` on a dev machine and you get three sections back: a toolchain version, an executor version, and a list of executors installed. The same word, '.NET', is naming all three at once.

10 min
#2

The CLR & Intermediate Language

Trace a method through both translations, C# to IL at build and IL to native at run, read its opcodes off the evaluation stack, find the method names in a .dll's metadata tables, and see why C# emits callvirt for a non-virtual call.

Run `dotnet build` on a one-line method and you get a `.dll`. Open it and the C# is gone, replaced by something that is neither your source nor your processor's machine code, a third language in between.

14 min
#3

JIT Compilation

Follow one method from its load-time stub to native code, watch a hot method get recompiled from Tier 0 to an optimized Tier 1 mid-run, and pin first-request latency on the JIT compiling every method in the call chain on first hit.

Call `Greet()` a thousand times and it runs in microseconds, but the very first call is measurably slower. The native code for it did not exist yet, and something had to build it in that gap.

12 min
#4

Native AOT

Publish one program two ways to see the native build drop the JIT and the IL, trace why a reflection call the trimmer cannot follow crashes at run time, prove a type sealed because nothing can subclass it, and place a workload where startup or steady-state decides between Native AOT, ReadyToRun, and the JIT.

Run `dotnet publish -r linux-x64` two ways on one console app and the output folders disagree: one drops a single file you can execute, the other a `MyApp.dll` that still needs translating into machine code as it runs.

12 min
#5

Assemblies & NuGet

Resolve a Version="8.0.0" constraint to the build NuGet actually picks under each of the four rules, locate the resolved graph in obj/project.assets.json instead of the .csproj, and separate a package's id-plus-SemVer from the four-part assembly identity the CLR loads by.

Type `Version="8.0.0"` into a project file and it reads as an exact order. It isn't: that number is a floor, and a solver walks every dependency you never typed to pick the versions that actually ship.

12 min
UNLOCKS
All units