DllImportResolver 委托
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于通过回调解析本机库的委托。
public delegate IntPtr DllImportResolver(System::String ^ libraryName, Assembly ^ assembly, Nullable<DllImportSearchPath> searchPath);
C#
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
要解析的本机库。
- assembly
- Assembly
请求解析的程序集。
- searchPath
- Nullable<DllImportSearchPath>
PInvoke 上的 DefaultDllImportSearchPathsAttribute(如果有)。 否则为程序集上的 DefaultDllImportSearchPathsAttribute(如果有)。 否则为 null
。
IntPtr
nativeint
成功时的已加载本机库的句柄,或失败时的 Zero。
运行时不会围绕 返回 DllImportResolver的句柄执行任何生存期管理。 它留给实现和使用代码,以根据需要保持库的加载时间,并在需要时释放它。
Get |
获取指示指定委托表示的方法的对象。 |
产品 | 版本 |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |