.NET runtime (CLR)
Microsoft’s open-source runtime for C#, F# and Visual Basic: the Common Language Runtime loads intermediate language, compiles it with a tiered JIT or ahead of time, and manages memory with a generational garbage collector.
- What it is
- Runtime virtual machines
- Type
- Open source
- Made by
- Microsoft (a .NET Foundation project)
- License
- MIT
- Facts checked
- 8 October 2026
What it is
Compilers for .NET languages emit Common Intermediate Language (CIL), a CPU-independent instruction set, plus metadata that describes every type and member, packed into portable executable files. The Common Language Runtime (CLR; its open-source implementation is called CoreCLR) loads them, checks that the code is type safe, and compiles each method to machine code with its JIT compiler, RyuJIT. Compilation is tiered, on by default since .NET Core 3.0: a method is first compiled quickly without optimisations, or taken from precompiled ReadyToRun code, and methods that stay busy are recompiled with full optimisation in the background. Because every compiler targets the same common type system, a class written in one language can be subclassed and called from another, and unlike the JVM the runtime lets programs define their own value types.
The garbage collector divides the heap into generations 0, 1 and 2 and keeps objects of 85,000 bytes or more on a separate large object heap. For start-up-sensitive apps, Native AOT compiles everything ahead of time into one self-contained executable for a single platform, such as Linux x64: no JIT at run time, faster start and a smaller memory footprint, but no loading assemblies at run time and no code generation with System.Reflection.Emit.
The runtime, libraries and SDK are open source under the MIT licence, in the dotnet/runtime repository, a .NET Foundation project maintained by Microsoft and the community. A new major version ships every November; even-numbered ones are Long Term Support releases with three years of free patches, odd-numbered ones Standard Term Support with two.
Why teams pick it
- One runtime for C#, F# and Visual Basic, with a common type system so the languages share classes and libraries directly
- Tiered compilation gives quick start-up and optimised steady state, and Native AOT removes the JIT entirely where start-up or a JIT-free environment matters
- User-defined value types (
struct) avoid heap allocation for small data, something the JVM doesn’t offer - Open source under MIT, cross-platform on Windows, Linux and macOS, with a predictable yearly release cycle
Watch out for
- Native AOT can’t load assemblies at run time, generate code with
Reflection.Emitor use C++/CLI, has no built-in COM on Windows, and requires trimming, which not every library supports - Under tiered compilation a method’s first calls run quick-JIT code, which can use more stack, allocate more memory and run slower until the optimised version replaces it
- Standard Term Support releases get only two years of patches, so teams that don’t want yearly upgrades have to stick to even-numbered versions
- The JIT and garbage collector add start-up time and memory compared with native code, unless the app is compiled with Native AOT
Alternatives
What all runtime virtual machines have in common →How it fits with other technologies
What uses .NET runtime (CLR)
Turn off tiered compilation, or publish a JIT-free native executable · bash
# run with full optimisation from the first call (slower start, no tier-0 code)
DOTNET_TieredCompilation=0 dotnet run -c Release
# on a Linux x64 machine: compile ahead of time into one native executable
# (the project file needs <PublishAot>true</PublishAot>)
dotnet publish -c Release -r linux-x64See it in a real stack
No architecture uses .NET runtime (CLR) yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2001–2022
In the late 1990s Java was spreading fast. Microsoft licensed it in 1996, was sued for extending it, and decided to build its own platform. Initially called COM+ 2.0 or Lightning, it got a bytecode, garbage collection and JIT compilation, and it was meant from the start to run many languages: an outreach effort called Project 7 tried to bring seven commercial and seven academic languages to it at launch. Anders Hejlsberg designed a new language for it, first called COOL, later C#.
Ecma published the Common Language Infrastructure as ECMA-335 in December 2001, and the .NET Framework’s CLR 1.0 shipped with Visual Studio .NET and C# 1.0 in January 2002. Microsoft’s implementation ran on Windows; the Mono project reimplemented .NET in a completely separate code base to run it on Linux, macOS and mobile devices.
On 12 November 2014 Microsoft announced that .NET Core, a modular, cross-platform rewrite, would be open source, runtime and libraries included. .NET 5, released on 10 November 2020, took .NET Core and the best of Mono into one platform, the single .NET going forward. Native AOT arrived with .NET 7 in November 2022.
Why it’s built this way
- A common language runtime, not a runtime for one language
- Earlier runtimes such as Java’s or Perl’s were built for a single language, and talking to other languages meant dropping to operating system primitives. A shared type system and garbage-collected objects let .NET languages call each other with high-level constructs.
- A high-level, typed intermediate language
- Type safety and garbage collection require the runtime to know the type of every field and to track every reference, so CIL carries detailed type information and verification checks it before the code runs.
- User-defined value types
- Treating everything as an object, as Smalltalk does, is hard to make fast. Java treats only built-in types like integers by value; the CLR also chose a mixed model but let programmers define their own value types.
- Open source and cross-platform
- Windows and Mono had separate code bases, so Mono had to reimplement .NET. Opening .NET Core aimed to give every platform one implementation and to build a stronger ecosystem.
Timeline
- 2001
ECMA-335, the Common Language Infrastructure, published in December
- 2002
CLR 1.0 ships with the .NET Framework and C# 1.0 in January
- 2014
Microsoft announces open-source .NET Core on 12 November
- 2020
.NET 5 released on 10 November as the single .NET
- 2022
.NET 7 adds Native AOT in November
- Don Syme: The Early History of F# (HOPL IV, 2020), section 3: Lightning, Project 7, COOL and C#
- Ecma International: ECMA-335 Common Language Infrastructure (1st edition December 2001)
- Microsoft Learn: .NET Framework versions and dependencies (CLR 1.0 with Visual Studio .NET)
- Microsoft Learn: The history of C# (C# 1.0, January 2002)
- .NET Blog: .NET Core is Open Source (12 November 2014)
- .NET Blog: Introducing .NET 5 (May 2019)
- .NET Blog: Announcing .NET 5.0 (10 November 2020)
- .NET Blog: .NET 7 is Available Today (8 November 2022)
- dotnet/runtime: Book of the Runtime, Introduction to the Common Language Runtime (multi-language support, value types)
Sources15 · facts checked 8 October 2026
- Microsoft Learn: Managed execution process (CIL, metadata, PE files, JIT, verification)
- Microsoft Learn: Common Language Runtime overview (common type system, cross-language integration)
- dotnet/runtime: Book of the Runtime, Introduction to the Common Language Runtime
- dotnet/runtime: Documentation index (the CoreCLR runtime)
- dotnet/runtime docs: JIT compiler structure (RyuJIT)
- Microsoft Learn: Runtime configuration options for compilation (tiered compilation, quick JIT, ReadyToRun)
- Microsoft Learn: Fundamentals of garbage collection (generations 0, 1, 2; large object heap at 85,000 bytes)
- Microsoft Learn: Native AOT deployment (benefits, limitations, target platforms)
- Microsoft Learn: What’s new in .NET 7 (Native AOT)
- Microsoft Learn: Introduction to .NET (open source, MIT, .NET Foundation, yearly November releases)
- Microsoft Learn: .NET language strategy (C#, F# and Visual Basic)
- .NET support policy (LTS three years, STS two years)
- .NET Blog: Introducing .NET 5 (Windows, Linux, macOS and more)
- dotnet/runtime README (MIT licence; .NET Foundation project)
- Ecma International: ECMA-335 Common Language Infrastructure (6th edition, June 2012)