Skip to content
AgileLogics
4 min read

How C# Code Runs: Compiling and the CLR

Prerequisites: Your first C# program

Like Java's bytecode-and-JVM model, C# compiles to an intermediate form called IL (Intermediate Language), which the CLR (Common Language Runtime) then runs — using a JIT compiler to turn IL into native machine code as the program executes.

dotnet build   # compiles to IL
dotnet run     # builds (if needed) and runs it under the CLR

This is exactly what makes the same compiled program portable across Windows, macOS, and Linux — the CLR for each platform knows how to run the same IL.