Library. Set Dll Import Resolver(Assembly, DllImportResolver) Method
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.
Sets a callback for resolving native library imports from an assembly.
public: static void SetDllImportResolver(System::Reflection::Assembly ^ assembly, System::Runtime::InteropServices::DllImportResolver ^ resolver);
public static void SetDllImportResolver (System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportResolver resolver);
static member SetDllImportResolver : System.Reflection.Assembly * System.Runtime.InteropServices.DllImportResolver -> unit
Public Shared Sub SetDllImportResolver (assembly As Assembly, resolver As DllImportResolver)
The assembly for which the resolver is registered.
The resolver callback to register.
A resolver is already set for this assembly.
This per-assembly resolver is the first attempt to resolve native library loads initiated by this assembly.
The callers of this method should register the resolver for their own assemblies only.
Only one resolver can be registered per assembly. Trying to register a second resolver fails with an InvalidOperationException.