ICLRRuntimeInfo::LoadLibrary Method

Loads a .NET Framework library from the common language runtime (CLR) represented by an ICLRRuntimeInfo interface.

This method supersedes the LoadLibraryShim function.


HRESULT LoadLibrary(  
     [in]  LPCWSTR pwzDllName,  
     [out, retval] HMODULE *phndModule);  


[in] The name of the assembly to be loaded.

[out] A handle to the loaded assembly.

Return Value

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

HRESULT Description
S_OK The method completed successfully.
E_POINTER pwzDllName or phndModule is null.
E_OUTOFMEMORY Not enough memory is available to handle the request.


This method only loads DLLs included in the .NET Framework redistributable package. It can not load user-generated assemblies.


Platforms: See System Requirements.

Header: MetaHost.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: Available since 4

See also