DllImportResolver Delegate
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a delegate used to resolve native libraries via callback.
public delegate IntPtr DllImportResolver(System::String ^ libraryName, Assembly ^ assembly, Nullable<DllImportSearchPath> searchPath);
public delegate IntPtr DllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath);
type DllImportResolver = delegate of string * Assembly * Nullable<DllImportSearchPath> -> nativeint
Public Delegate Function DllImportResolver(libraryName As String, assembly As Assembly, searchPath As Nullable(Of DllImportSearchPath)) As IntPtr
- libraryName
- String
The native library to resolve.
- assembly
- Assembly
The assembly requesting the resolution.
- searchPath
- Nullable<DllImportSearchPath>
The DefaultDllImportSearchPathsAttribute on the PInvoke, if any. Otherwise, the DefaultDllImportSearchPathsAttribute on the assembly, if any. Otherwise null
.
nativeint
The handle for the loaded native library on success, or Zero on failure.
The runtime does not do any lifetime management around the handle returned by a DllImportResolver. It is left to the implementation and consuming code to keep the library loaded for as long as necessary and free it if/when desired.
Get |
Gets an object that represents the method represented by the specified delegate. |
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: