System.DLLNotFoundException during runtime (start from visual studio 2017 - x86, debug)

-1

While running my program, when i open the main window, i get a System.DllNotFoundException. The complete exception i get from vs reads:

System.DllNotFoundException
  HResult=0x80131524
  Message=Die DLL "FTDIInterface.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
  Source=FTDILib
  StackTrace:
   at FTDILib.FTDID2XX_Interface.FTDI_Stop()
   at FTDILib.SerialConnection.FTDISerial.Stop()
   at FTDILib.SerialConnection.FTDISerial.Finalize()

i checked if the dll are in the correct directories. Then i used

dumpbin /dependents FTDIInterface.dll

to check for dependencies and got two: FTD2XX.dll and KERNEL32.dll

FTD2XX.dll exists in the same path as FTDIInterface.dll. It has four other dependencies:

SETUPAPI.dll, KERNEL32.dll, USER32.dll and ADVAPI32.dll

All those exist in C:\Windows\system32 which i added to the refernce paths in the properties of my project.

Why do i get this exception and how may i fix it? Thank you

windows
visual-studio
dll
asked on Stack Overflow Jul 18, 2019 by Myrkjartan

1 Answer

-1

I solved the problem by placing copies of FTDIInterface.dll and ftd2xx.dll in System32 and SysWOW64. I can't help but think, that it is very strange that i have to place my custom library inside a system folder. Any thoughts on the matter?

answered on Stack Overflow Jul 19, 2019 by Myrkjartan

User contributions licensed under CC BY-SA 3.0