Delegate-based C# P/Invoke alternative - compatible with all platforms and runtimes.
An important thing gotcha with DLSupport is that the library, by default, uses an extended library search pattern contrary to what one might be used to in “normal” circumstances. This is done in an attempt to make it easier for the end user to distribute multi-architecture assemblies with as little boilerplate code as possible, and in order to simplify distribution of standalone applications.
You can override this behaviour if it does not suit your application - see Advanced Configuration for more information.
In short, DLSupport follows, by default, this search order:
/some/path/to/libMyLib.so
)<entryDir>/lib
)<entryDir>/lib/x64
) or (<entryDir>/lib/x86
)<execDir>/lib
)<execDir>/lib/x64
) or (<execDir>/lib/x86
)<currDir>/
)
<currDir>/lib
)<currDir>/lib/x64
) or (<currDir>/lib/x86
)__Internal
, returns the main assemblyAt 3.
, the search diverges based on the platform that the library is running on. From here on out, DLSupport follows
its own implementation of the platform’s search implementation.
LD_LIBRARY_PATH
/etc/ld.so.cache
/lib
/usr/lib/
The paths listed in:
DYLD_FRAMEWORK_PATH
DYLD_LIBRARY_PATH
DYLD_FALLBACK_FRAMEWORK_PATH
DYLD_FALLBACK_LIBRARY_PATH
.\
)%WINDIR%\System32
%WINDIR%\System
%WINDIR%\
PATH