Export (0) Print
Expand All

ICLRDomainManager::SetAppDomainManagerType Method

Specifies the type, derived from the System.AppDomainManager class, of the application domain manager that will be used to initialize the default application domain.

HRESULT SetAppDomainManagerType(
    [in] LPCWSTR wszAppDomainManagerAssembly,
    [in] LPCWSTR wszAppDomainManagerType,
    [in] EInitializeNewDomainFlags dwInitializeDomainFlags
);

wszAppDomainManagerAssembly

[in] The display name of the assembly that contains the application domain manager type; for example: "AdMgrExample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6856bccf150f00b3".

wszAppDomainManagerType

[in] The type name of the application domain manager, including the namespace.

dwInitializeDomainFlags

[in] A combination of EInitializeNewDomainFlags enumeration values that provide information about the application domain manager.

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.

HRESULT

Description

S_OK

The method completed successfully.

HOST_E_CLRNOTAVAILABLE

The common language runtime (CLR) has not been loaded into a process, or the CLR is in a state in which it cannot run managed code or process the call successfully.

Currently, the only defined value for dwInitializeDomainFlags is eInitializeNewDomainFlags_NoSecurityChanges, which tells the common language runtime (CLR) that the application domain manager will not modify security settings during the execution of the AppDomainManager.InitializeNewDomain method. This allows the CLR to optimize the loading of assemblies that have the conditional AllowPartiallyTrustedCallersAttribute (APTCA) attribute. This can result in a significant improvement in startup time if the transitive closure of this set of assemblies is large.

Important noteImportant

If the host specifies eInitializeNewDomainFlags_NoSecurityChanges for the application domain manager, an InvalidOperationException is thrown if any attempt is made to modify the security of the application domain.

Calling the ICLRControl::SetAppDomainManagerType method is equivalent to calling ICLRDomainManager::SetAppDomainManagerType with eInitializeNewDomainFlags_None.

Platforms: See .NET Framework System Requirements.

Header: MetaHost.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: 4

Community Additions

ADD
Show:
© 2015 Microsoft