I am getting what seems to be a common issue in my C# program.
I have been looking online in many places and tring different solutions. ALl of whihc have so far failed.
I came across this post and tried their solution which did not work: Unable to load DLL The specified module could not be found
I downloaded dependancy walked to see if I was missing any other dlls which, it is reporting that I am but those dlls are the win-API dlls. Which according this link: https://social.msdn.microsoft.com/Forums/en-US/a28331ae-19a3-4a34-b3ba-1e8fd4430375/missing-apimswincore-dlls, it doesn't matter if dependency walker reports those as missing.
I have also downloaded and installed the VC++ redistribute 2015 x64 and x86 and I am still recieving the same error.
There was another post that recommended that I install the windows SDK. I did this for windows 10 and again, still the same error.(Missing dlls on 64 bit Win).
I have even tried placing the dll in system32 folder but again, no issue
I am running out of ideas on how to solve it so if anyone else ran into the same issue, any help would be appreciated.
For those wondering, I am developing on win 10 using VS2015.
EDIT:
The name of the DLL that I am using is called: SLABHIDtoUART.dll
My code for importing the functions is a as follows:
[DllImport("SLABHIDtoUART.dll")]
public static extern int HidUart_GetNumDevices(ref uint numDevices, ushort vid, ushort pid);
Here is the exact error:
System.DLLNotFoundException: Unable to load DLL 'SLABHIDtoUART.dll': The specified module could not be found (Exception from HRESULT: 0x8007007E)
Oh and I did change the compiler settings in VS from Any CPU to x86. Technically, I did not have that as an option by default and I needed to add a new option for the x86. After a recompile with the x86 compiler, the program still doesn't seem to be working.
I even moved all of the DLLs that the SLAB dll depends on and ran the program and the program still did not run. (SLAB dll depend on hid.dll, setupapi.dll, and kernal32.dll)