.NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection
What it is & where it is used
.NET is a developer platform: a runtime that executes code (the CLR), a huge class library (BCL), languages (C#, VB.NET, F#), SDK tools (dotnet CLI, compilers, NuGet) and app models (ASP.NET, WinForms, WPF, MAUI, Worker Services).
┌──────────────────────────────────────────────────────────────┐
│ Your code: C# · VB.NET · F# │
├──────────────────────────────────────────────────────────────┤
│ App models: ASP.NET Core · Web Forms/MVC (Framework) · WPF · │
│ WinForms · MAUI · Worker · Console │
├──────────────────────────────────────────────────────────────┤
│ Base Class Library (BCL): System, Collections, IO, Net, Linq, │
│ Threading, Text.Json, Data, Security … │
├──────────────────────────────────────────────────────────────┤
│ CLR (Common Language Runtime): JIT · GC · type system (CTS) · │
│ type safety · exceptions · threading · security · interop │
├──────────────────────────────────────────────────────────────┤
│ Operating system: Windows · Linux · macOS · (Android/iOS) │
└──────────────────────────────────────────────────────────────┘| Term | Full form | One line |
|---|---|---|
| CLR | Common Language Runtime | The virtual machine that loads, compiles (JIT), runs and manages .NET code |
| CTS | Common Type System | Rules for how types are defined and behave — shared by all .NET languages |
| CLS | Common Language Specification | Subset of CTS every language must support so libraries work across languages |
| IL / MSIL / CIL | (Microsoft/Common) Intermediate Language | CPU-independent instructions produced by the compiler |
| JIT | Just-In-Time compiler | Converts IL to native machine code at runtime (RyuJIT) |
| BCL / FCL | Base / Framework Class Library | Built-in libraries |
| GC | Garbage Collector | Automatic memory management |
| Managed code | — | Code executed under the CLR (memory, safety managed) |
| Unmanaged code | — | Native code outside the CLR (C/C++ DLLs, COM, Win32) — called via P/Invoke or COM interop |
Versions & history
Every .NET version (release year, what shipped, support status as of 2026):
.NET Framework (Windows only):
| Version | Year | CLR | Visual Studio | Headline features |
|---|---|---|---|---|
| 1.0 | 2002 | 1.0 | VS .NET 2002 | First release: CLR, C# 1.0, VB.NET, ASP.NET Web Forms, ADO.NET, WinForms |
| 1.1 | 2003 | 1.1 | VS .NET 2003 | ASP.NET mobile controls, ODBC/Oracle providers, side-by-side execution |
| 2.0 | 2005 | 2.0 | VS 2005 | Generics, nullable types, anonymous methods, partial classes, ASP.NET 2.0 (master pages, membership), 64-bit |
| 3.0 | 2006 | 2.0 | (VS 2005 extensions) | WPF, WCF, WF (Workflow), CardSpace |
| 3.5 | 2007 | 2.0 | VS 2008 | LINQ, C# 3.0, ASP.NET AJAX; 3.5 SP1 (2008): Entity Framework 1, ASP.NET Dynamic Data |
| 4.0 | 2010 | 4 | VS 2010 | TPL (Task), PLINQ, dynamic, MEF, Code Contracts, ASP.NET MVC 2 era |
| 4.5 | 2012 | 4 | VS 2012 | async/await, ASP.NET Web API, SignalR, Web Forms model binding |
| 4.5.1 / 4.5.2 | 2013 / 2014 | 4 | VS 2013 | Debugging and performance improvements |
| 4.6 – 4.6.2 | 2015 – 2016 | 4 | VS 2015 | RyuJIT for x64, ASP.NET 4.6, long-path support (4.6.2) |
| 4.7 – 4.7.2 | 2017 – 2018 | 4 | VS 2017 | TLS 1.2 defaults, high-DPI WinForms |
| 4.8 | 2019 | 4 | VS 2019 | Last major Framework version; JIT and accessibility updates |
| 4.8.1 | 2022 | 4 | VS 2022 | Native ARM64 support |
.NET Framework 4.8/4.8.1 is supported as part of Windows (no new features). Web Forms, WCF server and Windows Workflow exist only here.
.NET Core (cross-platform, open source):
| Version | Year | Type | Headline features |
|---|---|---|---|
| 1.0 | 2016 | — | Cross-platform runtime, ASP.NET Core 1.0, EF Core 1.0, project.json |
| 1.1 | 2016 | — | More APIs |
| 2.0 | 2017 | — | .NET Standard 2.0 (~32k APIs), Razor Pages, back to .csproj |
| 2.1 | 2018 | LTS | Span<T>, SignalR, HttpClientFactory, global tools |
| 2.2 | 2018 | — | Health checks, IIS in-process hosting |
| 3.0 | 2019 | — | WinForms & WPF on Windows, C# 8, Blazor Server, gRPC, endpoint routing, System.Text.Json |
| 3.1 | 2019 | LTS | Long-term support version of 3.0; Blazor improvements |
.NET 5 and later ("one .NET" — the successor of both Framework and Core):
| Version | Release | Support | C# | Headline features |
|---|---|---|---|---|
| .NET 5 | Nov 2020 | STS | 9 | Unified platform name (skipped "4" to avoid confusion with Framework), records, single-file apps |
| .NET 6 | Nov 2021 | LTS | 10 | Minimal APIs, hot reload, MAUI (2022), DateOnly, PriorityQueue, unified WebApplication |
| .NET 7 | Nov 2022 | STS | 11 | Generic math, rate limiting, output caching, Native AOT for console |
| .NET 8 | Nov 2023 | LTS | 12 | Native AOT for ASP.NET Core APIs, Blazor United (static SSR + interactive), TimeProvider, FrozenDictionary, Aspire (preview), keyed DI |
| .NET 9 | Nov 2024 | STS (extended to 24 months) | 13 | HybridCache, built-in OpenAPI generation, System.Threading.Lock, LINQ CountBy/AggregateBy, GC dynamic adaptation (DATAS) on by default for Server GC |
| .NET 10 | Nov 2025 | LTS | 14 | Extension members, field keyword, file-based apps (dotnet run app.cs), JIT de-virtualisation and stack allocation improvements, EF Core 10, ASP.NET Core 10 |
| .NET 11 | Nov 2026 (expected) | STS | 15 | In preview during 2026 |
Support policy: a new version every November; LTS (even numbers) = 3 years of support, STS (odd numbers) = 2 years (extended from 18 months starting with .NET 9). .NET Standard (1.0–2.1) was a specification of APIs shared by Framework, Core, Xamarin and Unity — target netstandard2.0 only for libraries that must still run on .NET Framework.
Lifecycle
From source code to running program:
- Write C#/VB.NET/F# source.
- Compile — Roslyn (
csc/vbc, run bydotnet build/MSBuild) produces an assembly (.dll/.exe) containing IL + metadata (types, members, references) + manifest (assembly name, version, culture, references, resources). - Launch — the host (
dotnet.exe/apphost/IIS ANCM) reads*.runtimeconfig.json, locates the right runtime version and starts the CLR (coreclr.dll/libcoreclr.so). - Load — the assembly loader loads the assembly and its dependencies (
*.deps.json) into an AssemblyLoadContext. - Type loading — the first use of a type builds its MethodTable (type info, method slots), runs its static constructor.
- JIT — the first call to a method compiles its IL to native code (tier 0, quick), replaces the stub; hot methods are recompiled with full optimisations (tier 1, possibly using profile data — Dynamic PGO).
- Execute — native code runs on the CPU; allocations go to the managed heap; the GC reclaims unreachable objects; exceptions unwind stack frames.
- Shutdown — finalizers may run, the process exits and the OS frees everything.
Tools used to develop
- Inspect IL/assemblies: ILSpy, dnSpy, dotPeek,
ildasm(Framework SDK), SharpLab.io (C# → IL → JIT assembly in the browser). - Diagnostics CLI:
dotnet-counters(GC, CPU, thread pool live),dotnet-trace(event traces),dotnet-dump(memory dumps +analyze),dotnet-gcdump(heap snapshots),dotnet-stack. - Profilers: Visual Studio Diagnostic Tools / Performance Profiler, PerfView, JetBrains dotMemory/dotTrace, WinDbg + SOS.
- Benchmarking: BenchmarkDotNet (
[MemoryDiagnoser]shows allocations). - Info:
dotnet --info,dotnet --list-runtimes,dotnet --list-sdks.