Provides a managed equivalent of an unmanaged host.
Assembly: mscorlib (in mscorlib.dll)
Gets the application activator that handles the activation of add-ins and manifest-based applications for the domain.
Gets the entry assembly for an application.
Gets the host execution context manager that manages the flow of the execution context.
Gets the host security manager that participates in security decisions for the application domain.
Gets the initialization flags for custom application domain managers.
Indicates whether the specified operation is allowed in the application domain.
|CreateDomain(String, Evidence, AppDomainSetup)|
Returns a new or existing application domain.
|CreateDomainHelper(String, Evidence, AppDomainSetup)|
Provides a helper method to create an application domain.
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Initializes the new application domain.
Returns a string that represents the current object.(Inherited from Object.)
The caller does not have the correct permissions. See the Requirements section.
Do not useto configure an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host.
Implementing 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:class enables a hosting application to participate in the creation of new application domains. To replace the default , identify the assembly and type of the replacement in the APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE environment variables, or use the
set APPDOMAIN_MANAGER_ASM=customappDomainmanager, Version=188.8.131.52, Culture=neutral, PublicKeyToken=f1368f7b12a08d72
If the assembly that contains your subclass of AllowPartiallyTrustedCallersAttribute (APTCA) attribute, you must include those assemblies in the list that you pass to the 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.depends on assemblies that are marked with the conditional
The AppDomain before other managed code runs. The can also supply host managers that participate in other aspects of common language runtime execution. For example, an can identify a HostSecurityManager object that participates in the security decisions of the application domain.is the managed equivalent of the unmanaged host. An object participates in the creation of new application domains in a process and can customize the new
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 example shows a very simple implementation of.
' To replace the default AppDomainManager, identify the ' replacement assembly and replacement type in the ' APPDOMAIN_MANAGER_ASM and APPDOMAIN_MANAGER_TYPE ' environment variables. For example: ' set APPDOMAIN_MANAGER_TYPE=library.TestAppDomainManager ' set APPDOMAIN_MANAGER_ASM=library, Version=184.108.40.206, Culture=neutral, PublicKeyToken=f1368f7b12a08d72 Imports System Imports System.Collections Imports System.Net Imports System.Reflection Imports System.Security Imports System.Security.Permissions Imports System.Security.Policy Imports System.Security.Principal Imports System.Threading Imports System.Runtime.InteropServices <assembly: System.Security.AllowPartiallyTrustedCallersAttribute()> <SecurityPermissionAttribute(SecurityAction.LinkDemand, _ Flags:=SecurityPermissionFlag.Infrastructure)> _ <SecurityPermissionAttribute(SecurityAction.InheritanceDemand, _ Flags:=SecurityPermissionFlag.Infrastructure)> _ <GuidAttribute("F4D15099-3407-4A7E-A607-DEA440CF3891")> _ Public Class MyAppDomainManager Inherits AppDomainManager Private mySecurityManager As HostSecurityManager = Nothing Public Sub New() Console.WriteLine(" My AppDomain Manager ") mySecurityManager = AppDomain.CurrentDomain.CreateInstanceAndUnwrap( _ "CustomSecurityManager, Version=220.127.116.11, Culture=neutral, " & _ "PublicKeyToken=5659fc598c2a503e", "MyNamespace.MySecurityManager") Console.WriteLine(" Custom Security Manager Created.") End Sub 'NewNew Public Overrides Sub InitializeNewDomain(ByVal appDomainInfo _ As AppDomainSetup) Console.Write("Initialize new domain called: ") Console.WriteLine(AppDomain.CurrentDomain.FriendlyName) InitializationFlags = _ AppDomainManagerInitializationOptions.RegisterWithHost End Sub 'InitializeNewDomain Public Overrides ReadOnly Property HostSecurityManager() _ As HostSecurityManager Get Return mySecurityManager End Get End Property End Class 'MyAppDomainManager
Requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
for derived classes to plug executable code into the common language runtime hosting infrastructure. Associated enumeration: SecurityPermissionFlag.Infrastructure.
Available since 2.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.