0

I want to use something similar to NativeLibrary.TryLoad for a native dll in dot net standard. But I cannot find a method for it. Is there a good way to do this?

I know a can do things like

[DllImport(@"alib.dll")] internal extern static int func();

but that is not what I want in this case. Im tracking a bug that cause a library to sometimes not load (from inside a dll that Im calling). So I want to preload it in my program and see if that helps.

AndersG
  • 81
  • 7

1 Answers1

0

You can use LoadLibrary or LoadLibraryEx (https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw).

Dan
  • 1,927
  • 2
  • 24
  • 35