Share via


ICLRRuntimeHost Interface

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

interface ICLRRuntimeHost : IUnknown {
        
    HRESULT ExecuteApplication (
        [in] LPCWSTR                   pwzAppFullName,
        [in] DWORD                     dwManifestPaths,
        [in] LPCWSTR                   *ppwzManifestPaths,   
        [in] DWORD                     dwActivationData,
        [in] LPCWSTR                   *ppwzActivationData,  
        [out] int                      *pReturnValue
    );
        
    HRESULT ExecuteInAppDomain (
        [in] DWORD                     appDomainId, 
        [in] FExecuteInDomainCallback  pCallback,
        [in] void*                     cookie
    );
        
    HRESULT ExecuteInDefaultAppDomain (
        [in] LPCWSTR                   pwzAssemblyPath, 
        [in] LPCWSTR                   pwzTypeName,
        [in] LPCWSTR                   pwzMethodName,
        [in] LPCWSTR                   pwzArgument,
        [out] DWORD                    *pReturnValue
    );
        
    HRESULT GetCLRControl (
        [out] ICLRControl              **pCLRControl
    );
        
    HRESULT GetCurrentAppDomainId (
        [out] DWORD                    *pdwAppDomainId
    );
        
    HRESULT SetHostControl (
        [in] IHostControl              *pHostControl
    );
        
    HRESULT Start();
        
    HRESULT Stop();
     
    HRESULT UnloadAppDomain (
        [in] DWORD                     dwAppDomainId
        [in] BOOL                      fWaitUntilDone
    );
        
};

Methods

Method Description

ICLRRuntimeHost::ExecuteApplication Method

Used in manifest-based ClickOnce Deployment scenarios to specify the application to be activated in a new domain.

ICLRRuntimeHost::ExecuteInAppDomain Method

Specifies the AppDomain in which to execute the specified managed code.

ICLRRuntimeHost::ExecuteInDefaultAppDomain Method

Invokes the specified method of the specified type in the specified assembly.

ICLRRuntimeHost::GetCLRControl Method

Gets an interface pointer of type ICLRControl Interface that hosts can use to customize aspects of the common language runtime (CLR).

ICLRRuntimeHost::GetCurrentAppDomainId Method

Gets the numeric identifier of the AppDomain that is currently executing.

ICLRRuntimeHost::SetHostControl Method

Sets the host control interface. You must call SetHostControl before calling Start.

ICLRRuntimeHost::Start Method

Initializes the CLR into a process.

ICLRRuntimeHost::Stop Method

Stops the execution of code by the runtime.

ICLRRuntimeHost::UnloadAppDomain Method

Unloads the AppDomain that corresponds to the specified numeric identifier.

Remarks

The host gets a pointer to an ICLRRuntimeHost instance by calling CorBindToRuntimeEx Function or CorBindToCurrentRuntime Function. To provide implementations of any of the technologies provided in the .NET Framework version 2.0, you must use ICLRRuntimeHost instead of ICorRuntimeHost Interface.

Important

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

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: MSCorEE.idl

Library: Included as a resource in MSCorEE.dll

.NET Framework Version: 2.0

See Also

Reference

CorBindToCurrentRuntime Function
CorBindToRuntimeEx Function
ICLRControl Interface
ICorRuntimeHost Interface

Other Resources

Hosting the Common Language Runtime
Hosting Interfaces