Skip to content
Learn Netverks

Lesson

Step 4/36 11% through track

dotnet-clr-preview

.NET and the CLR preview

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_compiled
Means
Compiled runner
Reading
~2 min
Level
beginner

This lesson

This lesson teaches .NET and the CLR preview: the syntax, patterns, and safety habits you need before advancing in C#.

Teams still ship .NET and the CLR preview in C# codebases—skipping it leaves gaps in debugging and code reviews.

You will apply .NET and the CLR preview in contexts like: .NET services, Unity games, and Windows-centric tooling.

Write C# with Console.WriteLine (top-level or Program), click Run on server—the dev runner uses dotnet build/run on a temp net8 project (requires .NET SDK; LEARNING_RUNNER_ENABLED=true).

At the start of the track—complete before lessons that assume you understand the compiled playground.

.NET is the platform; the CLR is the runtime that executes managed code. Understanding IL, assemblies, and JIT helps you read stack traces and reason about performance—similar in role to the JVM in Java.

Compilation pipeline

  1. C# compiler (Roslyn) emits IL (Intermediate Language) in assemblies (.dll / .exe)
  2. CLR loads assemblies and JIT-compiles hot methods to native CPU instructions
  3. Garbage collector reclaims unreachable objects on the managed heap

Assemblies and the BCL

An assembly is a deployment unit containing IL and metadata. The Base Class Library provides System.* types—Console, collections, LINQ, IO, and more. Web hosts and EF ship as separate packages in ASP.NET.

Important interview questions and answers

  1. Q: What is IL?
    A: CPU-neutral bytecode the CLR JIT-compiles—like JVM bytecode but for .NET.
  2. Q: Managed vs unmanaged code?
    A: Managed code runs under CLR with GC; unmanaged code (C APIs, raw pointers) needs explicit lifetime discipline.

Self-check

  1. What does JIT stand for in this context?
  2. What file extension do .NET assemblies often use?

Tip: Remember the pipeline: C# → IL → CLR JIT → native. Stack traces often mention IL offsets before JIT inlining.

Interview prep

What is IL?

Intermediate Language—CPU-neutral bytecode in assemblies that the CLR JIT-compiles to native machine code at runtime.

Managed vs unmanaged code?

Managed code runs under the CLR with GC; unmanaged code (P/Invoke, raw pointers) requires explicit lifetime discipline.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • GC generations?
  • Managed heap?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump