Common Language Runtime (CLR) is the workhorse behind .NET
Framework and applications running on top of it. Understanding CLR is
fundamental to understanding .NET. Very often .NET developers wonder why certain
things work in certain way, and they ask why VB.NET or C# works like this, when
it's not about the language but about the CLR.
Published recently by Microsoft Press, authored by Jeffrey
Richter, CLR via C#, 2nd Edition
is the book to cover what CLR is and how it works and what facilities it
offers. The book focuses on .NET Framework 2.0 and C# compiler version 8.0
while C# is used as demonstration language.
The book starts with Part 1 which covers basics of the CLR
execution model, application building, packaging, deployment, administration
and assemblies. Focus is on how .NET Framework is designed, what the terms
surrounding .NET Framework mean and defining what it includes when you build
and deploy a .NET application.
Part 2 describes the type system and explains the
distinction between primitive, reference and value types. Focus is on what
types in .NET Framework have as minimum set of behaviors and how do types,
objects, thread stacks and managed heap relate to one another.
Part 3 covers the fundamentals behind designing types and members
which constitute a type. Type and member basics, constants and fields, methods,
properties and events are covered in great detail.
Part 4 covers working with essential types in .NET Framework.
These include chars and strings, enumerated types and bit flags, arrays,
interfaces, delegates, generics, custom attributes and nullable types. Focus is
on what these are from CLR and .NET perspective and how do you get the most out
Part 5 covers CLR facilities such as exceptions, automatic
memory management, CLR hosting and AppDomains, assembly loading and reflection,
asynchronous operations and thread synchronization. Focus is on describing
mechanics behind these CLR facilities and what they do to ease life of a .NET