Book Review: Customizing the Microsoft .NET Framework Common Language Runtime

Book Review: Customizing the Microsoft .NET Framework Common Language Runtime

  • Comments 3

As you might have noticed from various posts on my blog I love understanding how things work. When I started learning the Microsoft .NET Framework 1.0 I delved into intermediate language (IL) for most of the assemblies and learned about the hosting interfaces. If you have such a passion for learning how things work then Customizing the Microsoft .NET Framework Common Language Runtime from MS Press by Steven Pratschner is the book for you.

Customizing the Microsoft .NET Framework Common Language Runtime delves into all the hosting interfaces and features of the .NET Framework 2.0. There's a lot of new control provided by the new hosting interfaces over the original hosting interfaces in .NET 1.0 and 1.1. Pratschner walks you through starting up and shutting down the Common Language Runtime (CLR), to configuring and securing application domains, all the way to optimizing performance for your host by managing memory used by the CLR to scheduling tasks and creating synchronization primitives. All the while he builds on a sample application that uses OLE structured storage documents to bundle custom managed assemblies and refers a lot to SQL Server 2005 - a driving force for many of the new hosting interfaces because of their strict requirement for memory management and task scheduling.

There is a lot of new interfaces available starting with .NET 2.0. A common naming convention helps to keep all these interfaces straight. It all starts in the same way as hosting the CLR for .NET 1.0 and 1.1: calling the CorBindToRuntimeEx function. For the new hosting interfaces, however, you must pass CLSID_CLRRuntimeHost for the rclsid parameter and IID_ICLRRuntimeHost for the riid parameter. From the returned pointer to the ICLRRuntimeHost interface you can get manager interfaces implemented by the CLR as well as provide manager interfaces implemented by your own host.

Pratschner keeps the book interesting and covers a lot of detail without very little redundancy (enough of what I consider helpful). The example host, called Cocoon, does a great job of demonstrating many of the hosting interfaces Pratschner describes, and is a great addition to the examples in the .NET Framework 2.0 SDK.

If you like understanding how things work, or want to host the CLR in your own application beyond COM interoperability, you should definitely read Customizing the Microsoft .NET Framework Common Language Runtime from MS Press by Steven Pratschner.

Leave a Comment
  • Please add 6 and 3 and type the answer here:
  • Post
  • I started reading the book mid summer last year but stopped it to pick up the Indigo documentation.

    I guess I will need to pick it back up and read it.
  • I'm reading about Windows Workflow Foundation now. I'll likely be using this in a new system I'm designing that hopefully I'll be talking more about in the coming months. After that it's to "Indigo". I've done the whole Remoting thing (as you know) so I figured it's time to crack open the next best thing. Thank goodness we don't have to worry about shared assembly deployment anymore like we did in our previous employment together!
  • How to package up Paint.NET in a tiny, easy-to-distribute, self-extracting executable.
Page 1 of 1 (3 items)