This documentation is archived and is not being maintained.

AppDomainManager.InitializeNewDomain Method

Note: This method is new in the .NET Framework version 2.0.

Initializes the new application domain.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

public virtual void InitializeNewDomain (
	AppDomainSetup appDomainInfo
)
public void InitializeNewDomain (
	AppDomainSetup appDomainInfo
)
public function InitializeNewDomain (
	appDomainInfo : AppDomainSetup
)

Parameters

appDomainInfo

An AppDomainSetup object that contains application domain initialization information.

This method is called immediately after the constructor. The default InitializeNewDomain implementation does nothing. A custom implementation can set up internal classes and delegates, set up an interface with the unmanaged host interface, or set up event handlers for the new AppDomain.

Also, for add-in activations, a custom implementation could identify the current AppDomain as the target application domain.

NoteNote

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

The following code sample shows an override of the InitializeNewDomain method for a custom application domain manager. This code example is part of a larger example provided for the AppDomainManager class.

public override void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
    Console.Write("Initialize new domain called:  ");
    Console.WriteLine(AppDomain.CurrentDomain.FriendlyName);
    InitializationFlags = 
        AppDomainManagerInitializationOptions.RegisterWithHost;
}

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: