RTM’d today: CLR via C#, Third Edition


Jeffrey Richter has completed CLR via C#, Third Edition and the book is at the printer!

We’ll post chapter excerpts when the book is available in a couple of weeks. Here is Jeffrey describing the book in his Introduction:

It was October 1999 when some people at Microsoft first demonstrated the Microsoft .NET
Framework, the common language runtime (CLR), and the C# programming language to me.
The moment I saw all of this, I was impressed and I knew that it was going to change the way
I wrote software in a very significant way. I was asked to do some consulting for the team and
immediately agreed. At first, I thought that the .NET Framework was an abstraction layer over
the Win32 API and COM. As I invested more and more of my time into it, however, I realized
that it was much bigger. In a way, it is its own operating system. It has its own memory manager,
its own security system, its own file loader, its own error handling mechanism, its own
application isolation boundaries (AppDomains), its own threading models, and more. This
book explains all these topics so that you can effectively design and implement software
applications and components for this platform.

I have spent a good part of my life focusing on threading, concurrent execution, parallelism,
synchronization, and so on. Today, with multicore computers becoming so prevalent, these
subjects are becoming increasingly important. A few years ago, I decided to create a book
dedicated to threading topics. However, one thing led to another and I never produced the
book. When it came time to revise this book, I decided to incorporate all the threading
information in here. So this book covers the .NET Framework’s CLR and the C# programming
language, and it also has my threading book embedded inside it (see Part V, “Threading”).

It is October 2009 as I write this text, making it 10 years now that I’ve worked with the .NET
Framework and C#. Over the 10 years, I have built all kinds of applications and, as a consultant
to Microsoft, have contributed quite a bit to the .NET Framework itself. As a partner in
my own company, Wintellect (http://Wintellect.com), I have worked with numerous customers
to help them design software, debug software, performance-tune software, and solve issues
they have with the .NET Framework. All these experiences have really helped me learn the
spots that people have trouble with when trying to be productive with the .NET Framework.
I have tried to sprinkle knowledge from these experiences through all the topics presented in
this book.

Who This Book Is For

The purpose of this book is to explain how to develop applications and reusable classes for
the .NET Framework. Specifically, this means that I intend to explain how the CLR works and
the facilities that it offers. I’ll also discuss various parts of the Framework Class Library (FCL).
No book could fully explain the FCL—it contains literally thousands of types now, and this
number continues to grow at an alarming rate. Therefore, here I’m concentrating on the core
types that every developer needs to be aware of. And while this book isn’t specifically about
Windows Forms, Windows Presentation Foundation (WPF), Silverlight, XML Web services, Web
Forms, and so on, the technologies presented in the book are applicable to all these
application types.

The book addresses Microsoft Visual Studio 2010, .NET Framework version 4.0, and version 4.0
of the C# programming language. Since Microsoft tries to maintain a large degree of backward
compatibility when releasing a new version of these technologies, many of the things
I discuss in this book apply to earlier versions as well. All the code samples use the C#
programming language as a way to demonstrate the behavior of the various facilities. But,
since the CLR is usable by many programming languages, the book’s content is still quite
applicable for the non-C# programmer.

Note  You can download the code shown in the book from Wintellect’s Web site
(http://Wintellect.com). In some parts of the book, I describe classes in my own Power
Threading Library. This library is available free of charge and can also be downloaded from
Wintellect’s Web site.

Today, Microsoft offers several versions of the CLR. There is the desktop/server version, which
runs on 32-bit x86 versions of Microsoft Windows as well as 64-bit x64 and IA64 versions
of Windows. There is the Silverlight version, which is produced from the same source code
base as the desktop/server version of the .NET Framework’s CLR. Therefore, everything in this
book applies to building Silverlight applications, with the exception of some differences in
how Silverlight loads assemblies. There is also a “lite” version of the .NET Framework called
the .NET Compact Framework, which is available for Windows Mobile phones and other
devices running the Windows CE operating system. Much of the information presented in
this book is applicable to developing applications for the .NET Compact Framework, but this
platform is not the primary focus of this book.

On December 13, 2001, ECMA International (http://www.ecma-international.org/) accepted
the C# programming language, portions of the CLR, and portions of the FCL as standards.
The standards documents that resulted from this have allowed other organizations to build
ECMA-compliant versions of these technologies for other CPU architectures, as well as other
operating systems. In fact, Novell produces Moonlight (http://www.mono-project.com/Moonlight),
an open-source implementation of Silverlight (http://Silverlight.net) that is
primarily for Linux and other UNIX/X11-based operating systems. Moonlight is based on the
ECMA specifications. Much of the content in this book is about these standards; therefore,
many will find this book useful for working with any runtime/library implementation that adheres
to the ECMA standard.

Note  My editors and I have worked hard to bring you the most accurate, up-to-date, in-depth,
easy-to-read, painless-to-understand, bug-free information. Even with this fantastic team
assembled, however, things inevitably slip through the cracks. If you find any mistakes in this
book (especially bugs) or have some constructive feedback, I would greatly appreciate it if you
would contact me at JeffreyR@Wintellect.com.

Comments (4)
  1. Dominique says:

    Nice book, will read. Please correct links in the article.

  2. Sorry about that; I have fixed the links.

  3. kalyan says:

    This book helped me a lot. Preorderd the 3rd edition. Buying a physical book after a long time. My Kindle DX is really good for technical books. Any plans on releasing it on Kindle.

  4. Charles Rex says:

    Hello Jeff,

    Related to Chapter 20, "Exceptions and State Management", here is what I do in order to not lose the line number where the original exception was thrown.

    private void SomeMethod()




       //I don’t want to lose the line number of the statement below

       throw new ArgumentException("— incorrect argument exception raised—");


     catch (Exception e)


      //if we must re-throw, don’t do this


      //do this instead

      throw (Exception)Activator.CreateInstance(e.GetType(), e.Message + e.StackTrace);



Comments are closed.

Skip to main content