Class NativeLibraryHelper
public static class NativeLibraryHelper
- Inheritance
-
NativeLibraryHelper
Methods
PreloadLibrary(string, Type)
Try to preload the library. This is useful when we want to have AnyCPU .NET and CPU-specific native code.
public static void PreloadLibrary(string libraryName, Type owner)
Parameters
libraryName
stringName of the library, without the extension.
owner
TypeType whose assembly location is related to the native library (we can't use GetCallingAssembly as it might be wrong due to optimizations).
Exceptions
- InvalidOperationException
Library could not be loaded.
RegisterDependency(string)
Registers a native dependency.
public static void RegisterDependency(string libraryPath)
Parameters
libraryPath
stringThe full path to the native library.
Exceptions
UnLoad(string)
UnLoad a specific native dynamic library loaded previously by PreloadLibrary(string, Type).
public static void UnLoad(string libraryName)
Parameters
libraryName
stringName of the library to unload.
UnLoadAll()
UnLoad all native dynamic library loaded previously by PreloadLibrary(string, Type).
public static void UnLoadAll()