If I specify only the name
[DllImport("example.dll", EntryPoint = "_foo@4")] private static extern int foo();
dll search is performed only in the system32 folder. I would like to connect dll'ku, located in the same folder with the program. How to do it?
Added.
If, without taking additional actions, simply put the dll in the program folder and do not put it in system32, an exception is caught:
System.DllNotFoundException: Unable to load dll "example.dll": The specified module could not be found. (Exception from HRESULT: 0x8007007E).