FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - Nebr

Pages: [1]
1
Discussion - Software / FTD2XX_NET.DLL - how do I make it work?
« on: March 22, 2023, 03:14:38 PM »
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.

Pages: [1]