You've been writing C# code — but what actually runs it? Behind every great architect is an entire city infrastructure: power grids, water systems, roads, and workers. In the C# world, that infrastructure is called .NET (pronounced "dot net").
Let's explore the city's infrastructure and understand how your blueprints become real buildings!
The .NET platform has evolved significantly over the years. Understanding this history will help you navigate the ecosystem like a pro:
The Common Language Runtime (CLR) is like a master foreman who translates your blueprints into actual construction. When you write C# code, you're drawing blueprints. The CLR reads those blueprints and builds the actual structures in memory.
The CLR handles:
The Base Class Library (BCL) is your standard toolbox. It contains thousands of pre-built classes organized into namespaces:
System — Core types: String, Int32, Console, Math, DateTimeSystem.Collections.Generic — Data structures: List, Dictionary, Queue, StackSystem.IO — File and stream operationsSystem.Linq — Powerful data querying (one of C#'s superpowers!)System.Net.Http — HTTP client for web requestsSystem.Threading.Tasks — Async/await and parallel programmingEver wonder what happens when you hit "Run"? Your code goes through an amazing transformation — like turning a paper blueprint into a real building:
Why this two-step process? Because IL is platform-independent! You compile once, and the JIT compiler optimizes it for whatever machine runs it — Windows, Linux, macOS, ARM, x86. It's like writing blueprints in a universal language that any construction crew in any country can read and build from.
C# lets you peek under the hood and see what version of .NET is powering your program. The Environment class provides this information: