NativeLibrary.SetDllImportResolver(Assembly, DllImportResolver) Metodo

Definizione

Imposta un callback per la risoluzione di importazioni di librerie native da un assembly.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

Parametri

assembly
Assembly

Assembly per cui viene registrato il resolver.The assembly for which the resolver is registered.

resolver
DllImportResolver

Callback del resolver da registrare.The resolver callback to register.

Eccezioni

assembly o paramref name="resolver" /> è null.assembly or paramref name="resolver" /> is null.

Un resolver è già impostato per questo assembly.A resolver is already set for this assembly.

Commenti

Questo resolver per assembly è il primo tentativo di risolvere i caricamenti della libreria nativa avviati dall'assembly.This per-assembly resolver is the first attempt to resolve native library loads initiated by this assembly.

Per ogni assembly può essere registrato un solo resolver.Only one resolver can be registered per assembly. Il tentativo di registrare un secondo resolver ha esito negativo con un InvalidOperationException.Trying to register a second resolver fails with an InvalidOperationException.

Si applica a