AlgoMaster Logo

.NET Ecosystem (CLR, BCL, SDK)

Last Updated: May 17, 2026

9 min read

C# doesn't run on its own. It runs on .NET, an open-source developer platform that bundles a runtime, a large standard library, and a set of command-line tools. This chapter walks through the pieces of that platform so the acronyms you'll see everywhere (CLR, BCL, SDK, CIL, NuGet) stop feeling like alphabet soup and start meaning something concrete.

What .NET Actually Is

.NET is a developer platform maintained by Microsoft and the .NET Foundation. It ships under an open-source license and runs on Windows, Linux, and macOS. When people say ".NET", they're really talking about three things bundled together:

  • A runtime that executes your compiled code.
  • A standard library that gives you primitives, collections, file I/O, HTTP, JSON, and so on out of the box.
  • A set of tools for building, testing, and packaging applications, with the dotnet command-line tool as the entry point.

C# is the most popular language on .NET, but it isn't the only one. F# (functional-first) and Visual Basic .NET also compile to the same runtime and share the same libraries. The platform is language-agnostic at the runtime level, which is why code written in any .NET language can call code written in any other.

The Unification Story (in Brief)

You'll still see references to ".NET Framework" and ".NET Core" in older blog posts. Here's the short version of how we got to today:

  • .NET Framework (2002 to 2019) was the original. Windows-only. Versions 1.0 through 4.8. It's in maintenance mode now and won't get new features.
  • .NET Core (2016 to 2019) was the cross-platform rewrite. It ran on Linux and macOS too.
  • .NET 5 (2020) merged the two branches into one. The word "Core" was dropped.
  • Since then, releases follow a yearly cadence: .NET 6, 7, 8, 9, and so on. .NET 8 is the current Long-Term Support (LTS) release and is what most teams use for new work.

For the rest of this course, when we say ".NET", we mean modern .NET (5 and up, unified). If you ever see a job listing that specifically says ".NET Framework 4.x", that's the older Windows-only platform, and it behaves a little differently. Modern .NET is the forward path.

The Big Picture

Think of .NET as a stack. Your C# code sits at the top. Below it, the standard library gives you ready-made building blocks. Below that, the runtime turns your compiled code into something the CPU can execute. At the bottom is the operating system.

Read it top to bottom. Your code calls into the BCL ("give me a List<Product>"). The BCL itself is just more compiled .NET code, so it runs on the CLR. The CLR talks to the operating system to get memory, threads, and system calls. The next few sections look at the middle layers in turn.

CLR: The Common Language Runtime

The CLR is the engine that runs your code. When you compile a C# program, the output isn't native machine code, it's an intermediate format that the CLR understands. The CLR's job is to take that intermediate code, turn it into instructions your CPU can actually execute, and manage the program while it runs.

It does three big things:

JIT compilation. JIT stands for Just-In-Time. The CLR doesn't translate the whole program upfront. Instead, the first time a method is called, the JIT compiles that method to native code, caches it, and runs it. The next time the same method is called, the cached native code runs directly. That's why C# code often feels slow on the first call and fast on subsequent calls.

Garbage collection (GC). When you create an object with new, the CLR allocates memory for it. When nothing in your program references that object anymore, the garbage collector eventually reclaims that memory and gives it back to the system. You don't call free or delete in C#. The GC handles it.

Type safety and the type system. The CLR knows the type of every object at runtime. If you try to cast a Product to an Order, the CLR catches it and throws an InvalidCastException instead of letting your program corrupt memory. This is what makes C# a memory-safe language.

We'll cover how the compilation actually flows (source -> intermediate code -> JIT -> native) in the _How C# Works (Compilation & Execution)_ lesson. For now, the shape is enough: the CLR is the engine, and JIT, GC, and the type system are its three main moving parts.

BCL: The Base Class Library

The BCL is the standard library that ships with .NET. It's a large collection of types organized into namespaces, and it's what lets you write useful programs without reinventing strings, lists, file readers, HTTP clients, and JSON parsers from scratch.

A handful of namespaces you'll touch constantly:

NamespaceWhat's In It
SystemCore primitives: String, Int32, Double, Boolean, DateTime, Console.
System.Collections.GenericGeneric collections: List<T>, Dictionary<TKey, TValue>, HashSet<T>, Queue<T>.
System.LinqLINQ operators for querying collections: Where, Select, OrderBy, GroupBy.
System.IOFile and stream APIs: File, Directory, StreamReader, Path.
System.Net.HttpThe modern HTTP client: HttpClient, HttpRequestMessage.
System.Text.JsonJSON serialization and deserialization.
System.Threading.TasksThe Task type and async helpers used by async/await.

You don't install any of these. They come with .NET. Pulling them into a file is a one-line using directive (and in .NET 6 and later, many of them are imported globally by default, so you often don't even write the using).

Here's a tiny program that touches two BCL namespaces at once: a generic collection from System.Collections.Generic, and a file reader from System.IO.

Nothing in that snippet is custom. List<string> lives in System.Collections.Generic. File lives in System.IO. Console and string live in System. The whole program is BCL types glued together with a few lines of your own logic.

The BCL is also where modern features live. JSON parsing? System.Text.Json. HTTP requests? System.Net.Http.HttpClient. Async primitives? System.Threading.Tasks.Task. For now, just know that "where does Dictionary<TKey, TValue> come from?" has a clean answer: it comes from the BCL, which ships with .NET.

CTS, CLS, and CIL: The Glossary You'll Keep Hearing

Three more acronyms show up in interview questions and Microsoft docs. You don't need to memorize their internals, but you should know what each one names.

  • CTS (Common Type System). The set of rules that defines what types look like across .NET. Every .NET language ultimately uses the same notion of "what's an int", "what's a class", "what's a struct". CTS is the reason C# and F# can share types without an adapter.
  • CLS (Common Language Specification). A subset of CTS rules that every .NET language is expected to follow. If you stick to CLS-compliant features in your public API, code written in any other .NET language can consume it without surprises.
  • CIL (Common Intermediate Language). The compact, CPU-independent instruction format that C# (and F#, and VB.NET) compiles to. The CLR's JIT compiler turns CIL into native machine code at runtime. You'll see CIL also called IL (short for "intermediate language") and MSIL (the older "Microsoft Intermediate Language" name). They all refer to the same thing.

So the chain goes like this: your C# source compiles to CIL, the CLR's JIT turns CIL into native code, and the CTS/CLS rules underneath make sure types behave consistently. We'll see the source-to-CIL-to-native pipeline up close in the _How C# Works (Compilation & Execution)_ lesson.

When you compile that, the compiler emits CIL instructions for the multiplication, the string interpolation, and the Console.WriteLine call. The CLR's JIT picks those up at runtime and produces real CPU instructions for whatever machine the program is running on.

SDK vs Runtime

.NET ships in two flavors, and which one you install depends on what you want to do.

The Runtime is the smaller of the two. It contains the CLR and the BCL, and it can run any compiled .NET application. That's all. No compiler. No CLI tools beyond what's needed to launch a program. You install just the Runtime on production servers where you only need to run apps, not build them.

The SDK is a superset. It contains the Runtime, plus the C# compiler, the dotnet command-line tool, project templates, and everything else you need to write and ship code. If you're developing on your laptop, this is what you install.

The dotnet CLI is the door into the SDK. A few commands you'll use constantly:

You'll meet all of these in the _Setting Up Environment_ and _First C# Program_ lessons. The point here is the conceptual split: SDK = development, Runtime = production.

NuGet: The Package Manager

The BCL covers a lot, but it doesn't cover everything. When you need a third-party library, a logging framework, an ORM, a Markdown parser, you reach for NuGet.

NuGet is the package manager for .NET. Public packages live at nuget.org, and you add one to your project with a single CLI command:

That command edits your project file to record the dependency, downloads the package, and makes its types available via using directives. We'll cover packages in depth in the Namespaces & Assemblies section. For now, the takeaway is that "I need library X" has a one-line answer in .NET, and it's the same answer on every operating system.

Project Types You'll See

When you run dotnet new, the SDK shows you a menu of project templates. Each one is a starting point for a different kind of application. Here are the ones worth knowing about up front:

TemplateWhat You Build
consoleA command-line app with a Main method. The default for learning C#.
web / webapiAn ASP.NET Core web API or website. Server-side request handling, routing, dependency injection.
mauiA .NET MAUI app. Cross-platform UI for iOS, Android, macOS, and Windows from one C# codebase.
blazorA Blazor web UI written in C# instead of JavaScript. Runs in the browser via WebAssembly, or on the server.
workerA long-running background service. Good for queue processors, scheduled jobs, daemons.
classlibA class library (.dll) you can share between projects or publish to NuGet.

You don't need to pick one yet. Almost everything in this course works inside a plain console project, and that's what we'll use until later sections introduce web or library scenarios. The reason to glance at the rest now is so the words "Blazor", "MAUI", "ASP.NET Core" aren't mysterious when you run into them.

The Full Component Map

Pulling everything from this chapter into one table for reference:

ComponentRole
CLR (Common Language Runtime)The execution engine. JIT-compiles code, runs the garbage collector, enforces type safety.
BCL (Base Class Library)The standard library shipped with .NET. Strings, collections, file I/O, HTTP, JSON, tasks.
SDK (Software Development Kit)Everything developers need: compiler, dotnet CLI, templates, plus the Runtime.
RuntimeA slimmer install for production: CLR + BCL only, no compiler or tooling.
CTS (Common Type System)The unified type rules every .NET language follows.
CLS (Common Language Specification)The subset of CTS rules a library should stick to for cross-language interop.
CIL (Common Intermediate Language)The portable instruction format C# compiles to. Also called IL or MSIL.
NuGetThe package manager for adding third-party libraries to a .NET project.

If you can read down that table and explain each row in a sentence, you have the conceptual foundation the rest of this course will build on.

Summary

  • .NET is an open-source developer platform from Microsoft and the .NET Foundation. It bundles a runtime (CLR), a standard library (BCL), and tools (dotnet CLI plus the SDK).
  • Modern .NET (.NET 5 and up, currently .NET 8 LTS) replaces the older Windows-only .NET Framework and the cross-platform .NET Core. There's only one .NET going forward.
  • The CLR is the runtime engine. It JIT-compiles your code to native instructions, runs the garbage collector, and enforces type safety.
  • The BCL is the standard library: System, System.Collections.Generic, System.Linq, System.IO, System.Net.Http, System.Text.Json, System.Threading.Tasks, and many more.
  • CTS, CLS, and CIL are the rules and intermediate format that make C# code portable across platforms and interoperable with other .NET languages.
  • The SDK is what developers install: it includes the compiler, the dotnet CLI, project templates, and the Runtime. The Runtime is the slimmer install for production: just the CLR and BCL.
  • NuGet is the package manager. dotnet add package <name> adds a third-party library to your project.
  • The dotnet new command offers templates for the kinds of projects you'll build: console, webapi, maui, blazor, worker, and classlib.

Now that you know what's in the .NET ecosystem, the _Setting Up Environment_ lesson installs it. We'll get the SDK on your machine, verify that dotnet --version works, and pick an editor so you're ready to write your first program.