# What .NET Is — C#/.NET

Source: https://www.skillbyai.com/en/dotnet/f-platform

> Explain the SDK, runtime, IL, JIT and base class library, and the .NET release cadence.

## A language, a runtime and a library

**C#** is a statically typed, object-oriented language with strong functional features. It runs on **.NET**, a free, open-source, cross-platform platform for Windows, Linux and macOS. The C# compiler (Roslyn) turns your code into **Intermediate Language (IL)** stored in an assembly (`.dll`). At run time the **Common Language Runtime (CLR)** loads the assembly and its **JIT compiler** turns IL into native machine code, method by method, with tiered compilation that re-optimises hot code. The CLR also provides **garbage collection**, type safety and exception handling. The **base class library (BCL)** gives you collections, I/O, networking, JSON, threading and much more. Modern **.NET** (5 and later, unified from .NET Core) is distinct from the older Windows-only **.NET Framework 4.x**. A new major version ships every November: even-numbered releases such as **.NET 10** are **Long Term Support (LTS)**, supported for three years, and odd-numbered releases are **Standard Term Support (STS)**.

## From source code to running program

C# compiles to IL; the runtime JIT-compiles IL to native code while the program runs.

![A source document flowing into a compiler gear, producing an intermediate package, which flows into a runtime box containing a lightning-bolt compiler and a recycling symbol for garbage collection.](assets/figures/dotnet/section-1-map.svg) — Figure 1.1 — C# source, IL assembly, CLR with JIT and garbage collector.

## Checking your installation

The SDK includes the compiler, runtime and the `dotnet` CLI.

```bash
dotnet --info            # SDK and runtime versions, OS, architecture
dotnet --list-sdks
dotnet --list-runtimes

# pin the SDK for a repository so everyone builds with the same version
dotnet new globaljson --sdk-version 10.0.100 --roll-forward latestFeature
```

## Framework is not Core

Tutorials for .NET Framework (Web Forms, `web.config`, `System.Web`) do not apply to modern .NET. For new projects, target the current LTS release unless you have a reason not to.

**Quiz:** What does the JIT compiler in the CLR do?

- [x] Turns IL into native machine code while the program runs
- [ ] Turns C# into IL at build time
- [ ] Collects unused objects
- [ ] Downloads NuGet packages

*Answer:* Turns IL into native machine code while the program runs. Roslyn produces IL at build time; the JIT converts IL to native code at run time.
