System.AppDomainManager Class

Provides a managed equivalent of an unmanaged host.

See Also: AppDomainManager Members


public class AppDomainManager : MarshalByRefObject



Do not use AppDomainManager to configure an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host.

Implementing the AppDomainManager class enables a hosting application to participate in the creation of new application domains. To replace the default AppDomainManager, identify the assembly and type of the replacement AppDomainManager in the APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE environment variables, or use the <appDomainManagerAssembly> and <appDomainManagerType> elements in your configuration file. The assembly must be fully trusted and be contained in the global assembly cache or the directory of the starting application. The type and assembly names must be fully qualified in the environment variables. For example:

set APPDOMAIN_MANAGER_TYPE=MyNamespace.TestAppDomainManager

set APPDOMAIN_MANAGER_ASM=customappDomainmanager, Version=, Culture=neutral, PublicKeyToken=f1368f7b12a08d72


If the assembly that contains your subclass of AppDomainManager depends on assemblies that are marked with the conditional System.Security.AllowPartiallyTrustedCallersAttribute (APTCA) attribute, you must include those assemblies in the list that you pass to the AppDomainSetup.PartialTrustVisibleAssemblies property of the AppDomainSetup you use to create application domains. Otherwise, the assemblies that are marked with the conditional APTCA attribute will be disabled.

The AppDomainManager is the managed equivalent of the unmanaged host. An AppDomainManager object participates in the creation of new application domains in a process and can customize the new AppDomain before other managed code runs. The AppDomainManager can also supply host managers that participate in other aspects of common language runtime execution. For example, an AppDomainManager can identify a System.Security.HostSecurityManager object that participates in the security decisions of the application domain.


Only assemblies granted FullTrust, such as assemblies in the global assembly cache or identified as fullTrustAssemblies in the AppDomain.CreateDomain(string, System.Security.Policy.Evidence, AppDomainSetup, System.Security.PermissionSet, System.Security.Policy.StrongName[]) method can be loaded in the AppDomainManager.#ctor constructor and the AppDomainManager.InitializeNewDomain(AppDomainSetup) method.


This class contains a link demand and an inheritance demand at the class level. A System.Security.SecurityException is thrown when either the immediate caller or the derived class does not have infrastructure permission. For details about security demands, see Link Demands and Inheritance Demands.


Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions:,
Since: .NET 2.0