Method TryLoad
- Namespace
- Ubiquity.NET.InteropHelpers
- Assembly
- Ubiquity.NET.InteropHelpers.dll
TryLoad(string, out NativeLibraryHandle)
Provides a simple API for loading a native library and returns a value that indicates whether the operation succeeded.
public static bool TryLoad(string libraryPath, out NativeLibraryHandle lib)
Parameters
libraryPath
stringThe name of the native library to be loaded.
lib
NativeLibraryHandleNative library handle.
Returns
Exceptions
- ArgumentNullException
libraryPath
is null.
TryLoad(string, Assembly, DllImportSearchPath?, out NativeLibraryHandle)
Provides a high-level API that loads a native library and returns a value that indicates whether the operation succeeded.
public static bool TryLoad(string libraryName, Assembly assembly, DllImportSearchPath? searchPath, out NativeLibraryHandle lib)
Parameters
libraryName
stringThe name of the native library to be loaded.
assembly
AssemblyThe assembly loading the native library.
searchPath
DllImportSearchPath?The search path.
lib
NativeLibraryHandleNative library Handle
Returns
Exceptions
- ArgumentNullException
libraryPath
orassembly
is null.- ArgumentException
assembly
is not aRuntimeAssembly
.