AssemblyLoadContext.LoadUnmanagedDll(String) Method


Allows derived class to load an unmanaged library by name.

 virtual IntPtr LoadUnmanagedDll(System::String ^ unmanagedDllName);
protected virtual IntPtr LoadUnmanagedDll (string unmanagedDllName);
abstract member LoadUnmanagedDll : string -> nativeint
override this.LoadUnmanagedDll : string -> nativeint
Protected Overridable Function LoadUnmanagedDll (unmanagedDllName As String) As IntPtr



Name of the unmanaged library. Typically this is the filename without its path or extensions.


A handle to the loaded library, or Zero.


The default implementation always returns IntPtr.Zero. When IntPtr.Zero is returned, the runtime loads the library with its default policy.

This virtual method can be overridden to customize the unmanaged library search algorithm. When overridden the name can be used to identify the library. The loaded library does not need to match the requested name, but can be transformed as needed. This could include adjusting the name for platform specific naming.

Applies to