ICLRRuntimeHost Interface


Provides functionality similar to that of the ICorRuntimeHost interface provided in the .NET Framework version 1, with the following changes:

  • The addition of the SetHostControl method to set the host control interface.

  • The omission of some methods provided by ICorRuntimeHost.

ExecuteApplication MethodUsed in manifest-based ClickOnce deployment scenarios to specify the application to be activated in a new domain.
ExecuteInAppDomain MethodSpecifies the AppDomain in which to execute the specified managed code.
ExecuteInDefaultAppDomain MethodInvokes the specified method of the specified type in the specified assembly.
GetCLRControl MethodGets an interface pointer of type ICLRControl that hosts can use to customize aspects of the common language runtime (CLR).
GetCurrentAppDomainId MethodGets the numeric identifier of the AppDomain that is currently executing.
SetHostControl MethodSets the host control interface. You must call SetHostControl before calling Start.
Start MethodInitializes the CLR into a process.
Stop MethodStops the execution of code by the runtime.
UnloadAppDomain MethodUnloads the AppDomain that corresponds to the specified numeric identifier.

Starting with the .NET Framework 4, use the ICLRMetaHost interface to get a pointer to the ICLRRuntimeInfo interface, and then call the ICLRRuntimeInfo::GetInterface method to get a pointer to ICLRRuntimeHost. In earlier versions of the .NET Framework, the host gets a pointer to an ICLRRuntimeHost instance by calling CorBindToRuntimeEx or CorBindToCurrentRuntime. To provide implementations of any of the technologies provided in the .NET Framework version 2.0, you must use ICLRRuntimeHost instead of ICorRuntimeHost.

System_CAPS_ICON_important.jpg Important

Do not call the Start method before calling the ExecuteApplication method to activate a manifest-based application. If the Start method is called first, the ExecuteApplication method call will fail.

Platforms: See System Requirements.

Header: MSCorEE.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: Available since 2.0

CorBindToCurrentRuntime Function
CorBindToRuntimeEx Function
Hosting Overview
ICLRControl Interface
ICorRuntimeHost Interface
Hosting Interfaces
CLRRuntimeHost Coclass