Flylib.com

Books Software

 
 
 

Acknowledgments


Acknowledgments

Writing this book has been a daunting task at times. I've relied on several people throughout this project for everything from technical assistance to help with the logistics of writing a book to encouragement and support. In particular, I thank Jeff Richter for his help throughout the project. Not only did Jeff help me get started, but his technical expertise and writing experience have been absolutely invaluable.

In addition, the following individuals helped make sure this book is technically accurate and easily readable: Dennis Angeline, Mason Bendixen, Chris Brown, Christopher Brumme, Alessandro Catorcini, Suzanne Cook, Mike Downen, Patrick Dussud, Greg Fee, Brian Grunkemeyer, Jonathan Hawkins, Jim Hogg, Jonathan Keljo, Sonja Keserovic, Jim Kieley, Raja Krishnaswamy, Tim Kurtzman, Bryan Lamos, Sebastian Lange, WeiWen Liu, Rudi Martin, Frank Peschel-Gallee, Sonia Pignorel, Mahesh Prakriya, Michael Rayhelson, Beysim Sezgin, Alan Shi, Craig Sinclair, Tarik Soulami, Jan Stranik, Sean Trowbridge, Dino Viehland, Kimberly Wolk, and Junfeng Zhang.

The people at Microsoft Press put in untold numbers of hours making sure everything fits together just so. They do an incredible job. As a first-time author, I certainly needed extra help at times. Thanks so much to Kathleen Atkins, Ben Ryan, Christina Palaia, Sally Stickney, and Robin Van Steenburgh for guiding me through this project and producing my book.

Finally, I'm eternally grateful for the people in my personal life who continue to give me so much love and support. In addition to my daughters Erin and Katherine and my wife Maraye, I'd also like to thank Zo Van Eaton and my parents Joe and Audrey Pratschner. I wouldn't have been able to reach this goal without all of you there to help me.


Introduction

The introduction of Microsoft .NET Framework 2.0 marks the third major release of the core component in the Microsoft .NET platform strategy. With each subsequent release of the .NET Framework, the reach of the .NET platform is extended as the managed code programming model is made available in more application models. For example, .NET Framework 2.0 is the first version of the .NET Framework that will be integrated with the Microsoft SQL Server database system. In addition, many key architectural changes have been made in .NET Framework 2.0 in preparation for its deeper integration with future versions of the Windows operating system.

The presence of the .NET programming model in so many different application environments is possible only because the .NET Framework's core execution engine, the Common Language Runtime (CLR), is flexible enough to support application environments with a wide range of requirements. In .NET Framework 2.0, several new extensibility points have been added that make the CLR much more customizable than in previous releases. Fortunately, the same techniques that Microsoft uses to integrate the CLR into products such as Internet Explorer, SQL Server, and Internet Information Server are available for you to achieve the same level of integration between the CLR and your own product.


What Makes This .NET Framework Book Unique?

Numerous books have been written about the .NET Framework and the CLR since their introduction in early 2002. This book is different in that it is targeted at those developers who want to dig deeper into the subject of .NET Framework programming and expand their overall knowledge of how the CLR works. Most of the topics I cover in this book aren't found in introductory books about the .NET Framework. Instead, I cover those advanced and unfamiliar topics that will help you (once you are familiar with them) write more flexible, reliable, and secure applications.

A few years ago, I worked on a CLR subteam responsible for integrating the CLR into products like SQL Server and Windows. During that time, I realized that many of the features the CLR team was building to support these application models make the CLR much more flexible and customizable in a way that enables developers outside of Microsoft to integrate the CLR into their own applications as well. To that end, many of the topics I cover in this book are of direct use to those developers hoping to integrate the CLR into their existing products, to write applications that are extensible, or to customize the way the CLR works by default. The following list gives you a flavor of the topics I cover, many of which are new to .NET Framework 2.0:

  • Using the CLR hosting APIs to customize the CLR from unmanaged code

  • Configuring the CLR startup parameters, including version and build type

  • Using application domains to isolate effectively groups of assemblies running in a process

  • Configuring application domains to best meet your specific requirements

  • Managing multiple application domains easily by writing an application domain manager

  • Understanding strategies for dynamically loading assemblies into your application domains

  • Diagnosing assembly loading failures

  • Loading assemblies from custom file formats and locations

  • Specifying your own assembly version policy

  • Using domain-neutral assemblies to reduce the amount of memory consumed by applications that use several application domains

  • Customizing the Code Access Security (CAS) system to restrict the permissions granted to the code running in your process

  • Using a new feature named host protection to enforce programming model constraints that are specific to your application

  • Controlling the way the CLR behaves in the face of exceptional conditions, such as out of memory errors and stack overflows, to protect the integrity of your process

  • Configuring the CLR's garbage collector

  • Replacing the primitives the CLR uses to allocate memory to track memory usage or restrict the amount of memory the CLR can use

  • Integrating the CLR into an environment that relies on Win32 fibers or any other mechanism that requires cooperative task scheduling

Even if CLR integration or extensibility isn't your current goal, a deeper understanding of .NET Framework programming will help make the applications you're writing today better. For example, learning about the subtleties that can occur when multiple versions of the .NET Framework are installed on the same machine can help you design your application so that it is not affected when a new version of the .NET Framework gets deployed; knowing how application domains are used for isolation can help you build applications that are more reliable and secure. Also, if you happen to be a developer who writes components for use within other applications, this book can help you understand how the applications that use your components are likely to be designed. This knowledge can help you write add-ins that more seamlessly integrate with the applications that host them.