Thursday, December 23, 2010

Understanding .NET Application Domains

Understanding .NET Application Domains

Assuming you understand the role of Windows processes and how to interact with them from managed code, you must investigate the concept of a .NET application domain. To run your managed .NET code in a process, you create assemblies. These assemblies are not hosted directly within a Windows process. Instead, the common language runtime (CLR) isolates this managed code by creating separate logical partitions within a process called an application domain. A single process may contain multiple application domains, each of which is hosting distinct pieces of code encapsulated in assemblies. This subdivision of a traditional Windows process offers several benefits provided by the .NET Framework.

The main benefits are as follows:

• Application domains provide the operating system–neutral nature of the .NET platform by abstracting away the concept of an executable or library.
• Application domains can be controlled and (un)loaded, as you want.
• Application domains provide isolation for an application or within a process where multiple application domains live. Application domains within a process are independent of each other and as such remain functional when one fails the other.

No comments:

Post a Comment