NativeLibrary.Load 메서드

정의

오버로드

Load(String)

OS 로더를 래핑하고 기본 플래그를 사용하는 네이티브 라이브러리를 로드하기 위한 간단한 API를 제공합니다.

Load(String, Assembly, Nullable<DllImportSearchPath>)

네이티브 라이브러리를 로드하기 위한 상위 수준 API를 제공합니다.

Load(String)

Source:
NativeLibrary.cs
Source:
NativeLibrary.cs
Source:
NativeLibrary.cs

OS 로더를 래핑하고 기본 플래그를 사용하는 네이티브 라이브러리를 로드하기 위한 간단한 API를 제공합니다.

public:
 static IntPtr Load(System::String ^ libraryPath);
public static IntPtr Load (string libraryPath);
static member Load : string -> nativeint
Public Shared Function Load (libraryPath As String) As IntPtr

매개 변수

libraryPath
String

로드할 네이티브 라이브러리의 이름입니다.

반환

IntPtr

nativeint

로드된 네이티브 라이브러리의 OS 핸들입니다.

예외

libraryPath이(가) null인 경우

라이브러리를 찾을 수 없습니다.

라이브러리가 올바르지 않습니다.

적용 대상

Load(String, Assembly, Nullable<DllImportSearchPath>)

Source:
NativeLibrary.cs
Source:
NativeLibrary.cs
Source:
NativeLibrary.cs

네이티브 라이브러리를 로드하기 위한 상위 수준 API를 제공합니다.

public:
 static IntPtr Load(System::String ^ libraryName, System::Reflection::Assembly ^ assembly, Nullable<System::Runtime::InteropServices::DllImportSearchPath> searchPath);
public static IntPtr Load (string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath);
static member Load : string * System.Reflection.Assembly * Nullable<System.Runtime.InteropServices.DllImportSearchPath> -> nativeint
Public Shared Function Load (libraryName As String, assembly As Assembly, searchPath As Nullable(Of DllImportSearchPath)) As IntPtr

매개 변수

libraryName
String

로드할 네이티브 라이브러리의 이름입니다.

assembly
Assembly

네이티브 라이브러리를 로드하는 어셈블리입니다.

searchPath
Nullable<DllImportSearchPath>

검색 경로입니다.

반환

IntPtr

nativeint

로드된 라이브러리의 OS 핸들입니다.

예외

libraryName 또는 assemblynull인 경우

assembly이(가) RuntimeAssembly가 아닌 경우

라이브러리를 찾을 수 없습니다.

라이브러리가 올바르지 않습니다.

설명

라이브러리 이름이 지정되면 이 메서드는 런타임 구성, 입력 매개 변수 및 호출 어셈블리의 특성에 따라 특정 경로를 검색합니다. 매개 변수가 searchPath null이 아닌 경우 이 열거형의 플래그가 사용됩니다. 그렇지 않으면 호출 어셈블리의 에서 지정한 DefaultDllImportSearchPathsAttribute 플래그(있는 경우)가 사용됩니다. 이 메서드는 메서드를 사용하여 SetDllImportResolver(Assembly, DllImportResolver) 등록된 확인자를 호출하지 않습니다. .NET 5부터 이 메서드는 메서드 및 이벤트를 호출 AssemblyLoadContext.LoadUnmanagedDll 합니다 AssemblyLoadContext.ResolvingUnmanagedDll .

적용 대상