Hello, I have a seemingly very basic problem that I was unable to solve. I want to program an MX-Series II device with the help of the D2XX driver. I have seen that there exists a C# wrapper, the FTD2XX_NET.DLL. So i downloaded the wrapper and tried to create a very simple console app just to test the proper working:
var myClass = new FTD2XX_NET.FTDI();
string desc;
myClass.GetDescription(out desc);
Console.WriteLine(desc);
Console.ReadLine();
I added a reference to the FTD2XX_NET.DLL to my project and also installed the D2XX driver by downloading and executing the driver file CDM212364_Setup.exe. The drivers were properly installed in my temporary driver store (C:\Windows\System32\DriverStore\FileRepository), so it seems that this worked. But when I run the program, I get the error message
"Attempting to load FTD2XX.DLL from:
C:\MyConsoleApp\bin\Debug\net6.0
Failed to load FTD2XX.DLL. Are the FTDI drivers installed?"
Referencing the ftd2xx.dll in my project won't work ("The reference is invalid or unsupported"). Putting the dll into the bin\Debug\net6.0 folder does not change anything. I even tried to import the DLL directly via DllImport:
[DllImport("ftd2xx.dll")]
static extern uint FT_ListDevices();
However, I only get a System.BadImageFormatException.
I also tried to get the example codes provided working, but I failed as well. The USBTransfer example shows exactly the same problem with the AID.DLL.
I seem to be unable to get this working. What am I doing wrong? Can anybody help me here?
Version info: I am using Windows 11 Pro and Microsoft Visual Studio Professional 2022 (64-bit), Version 17.4.4. The wrapper version is FTD2XX_NET_v1.2.0.