Synopses & Reviews
Packed with expert guidelines and advice, this is the advanced reference you need to customize common language runtime (CLR) applications now—and as you move to Microsoft .NET Framework 2.0 and Microsoft Visual Studio 2005. Microsoft program manager Steven Pratschner takes you inside the workings of the CLR, showing you how it functions, and how to tailor its features for the unique requirements of your application. You’ll go from configuring basic startup parameters to controlling critical runtime notations—including how code is loaded into the process, how memory is managed, and when code is scheduled to run. Find the detailed information and insights you need—and take full advantage of the increased flexibility and programmability of the CLR.
Discover how to:
- Write your own CLR host—or customize the default host—to control startup and shutdown
- Use application domains and domain managers to effectively isolate groups of assemblies
- Learn key strategies for loading and customizing assemblies in extensible applications
- Extend and customize the Code Access Security (CAS) system to help protect your extensible application
- Unload a domain without leaking resources—and make code more reliable—using safe handles, critical finalizers, and constrained execution regions
- Use the host protection feature for application-specific programming model constraints
- Create and manage tasks with custom schedulers and thread pools
Covers Microsoft .NET Framework 2.0
Get code samples on the Web:
For information on code samples and system requirements, please see the Introduction.
- Get expert insights on how the common language runtime works from the inside
- Learn how to extend the CLR Security System to help protect your applications
- Understand assemblies and how to make them work for you
About the TechnologyThis book focuses on the latest release of the Microsoft .NET Framework and on the new features in Visual Studio 2005, code named "Whidbey," aimed at customizing the common language runtime to work in a variety of application environments. Developers who have already made the move to .NET development are now ready for advanced topics, while others are feeling the momentum and are seeking information.
About the Author
Steven Pratschner is a program manager on the .NET Compact Framework team at Microsoft. As a former team member for the full .NET Framework, he worked on several CLR features, including the versioning system, hosting, and the security system. Steven has written articles and presented at numerous conferences on a variety of topics related to .NET Framework-based programming. He holds computer science degrees from North Dakota State University and Santa Clara University.
Table of Contents
Foreword; Acknowledgments; Introduction; What Makes This .NET Framework Book Unique?; The .NET Framework 2.0 Prereleases; Sample Code and System Requirements; Comments, Corrections, and Support; Chapter 1: CLR Hosts and Other Extensible Applications; Summary; Chapter 2: A Tour of the CLR Hosting API; CorBindToRuntimeEx and ICLRRuntimeHost; CLR Hosting Managers; CLR Initialization and Startup; Other Unmanaged Functions on mscoree.dll; Hosting Manager Discovery; Overview of the Hosting Managers; Summary; Chapter 3: Controlling CLR Startup and Shutdown; The CLR Startup Configuration Settings; Setting the Startup Options Using CorBindToRuntimeEx; Starting the CLR; Handling Failures from CorBindToRuntimeEx; Deferring CLR Initialization and Startup; The CLR and Process Lifetime; Summary; Chapter 4: Using the Default CLR Host; Invoking the Default Host: Running Managed Executables; Invoking the Default Host: Activating Managed Types Through COM Interop; Defaults for the CLR Startup Options; Customizing the Default Host Using Configuration Files; Summary; Chapter 5: Using Application Domains Effectively; The Role of Application Domains; Application Domain Structure; Guidelines for Partitioning a Process into Multiple Application Domains; Application Domain Managers; Application Domains and Threads; Unloading Application Domains; Summary; Chapter 6: Configuring Application Domains; Application Domain Configuration Settings; Private Assembly Directory Settings; Configuration File Settings; Shadow Copy Settings; Assembly Binding Settings; Miscellaneous Settings; Customizing Application Domain Creation Using System.AppDomainManager; Summary; Chapter 7: Loading Assemblies in Extensible Applications; Concepts and Terminology; Loading Assemblies by Assembly Identity; Loading Assemblies by Filename; Loading Assemblies Using ICLRRuntimeHost; Capturing Assembly Load Events; Versioning Considerations for Extensible Applications; Summary; Chapter 8: Customizing How Assemblies Are Loaded; The Cocoon Deployment Model; Implementing an Assembly Loading Manager; Customizing How Assemblies Are Loaded Using Only Managed Code; Summary; Chapter 9: Domain-Neutral Assemblies; Domain-Neutral Assembly Architecture; Specifying Which Assemblies Are Loaded Domain Neutral; Determining Whether an Assembly Has Been Loaded Domain Neutral; Summary; Chapter 10: Extending the CLR Security System to Protect Your Extensible Application; An Overview of Code Access Security; Customizing the Code Access Security System Using a HostSecurityManager; Code Access Security in the Cocoon Host; Associating Evidence with an Application Domain; The AllowPartiallyTrustedCallers Attribute; Summary; Chapter 11: Writing Highly Available Microsoft .NET Framework Applications; Application Domain Isolation and Process Lifetimes; Specifying Escalation Policy Using the CLR Hosting Interfaces; Guidelines for Writing Highly Available Managed Code; Summary; Chapter 12: Enforcing Application-Specific Programming Model Constraints; The Host Protection Categories; Using the Host Protection Manager; Host Protection in the Cocoon Deployment Model; Summary; Chapter 13: Managing How the CLR Uses Memory; Integrating the CLR with Custom Memory Managers; Configuring the CLR Garbage Collector; Summary; Chapter 14: Integrating the CLR with Custom Schedulers and Thread Pools; The Task Abstraction; Controlling the Execution of Tasks; Summary; Appendix : About the Author;