BadImageFormatException in stereolabs.zed running a Windows Forms application

Hello! I’m new to ZED and I would like to create my first application using c# (.net framework 4.6.1) in Windows Forms environment. I have created the solution and I got stereolabs.zed.dll and sl_zed_interface.dll from nuget.
If I run the program I get the error BadImageFormatException for stereolabs.zed or one of its dependencies.
What should I do to fix the problem? Is there a way to compile the application using directly Visual Studio 2019 without using CMake (I’m not able to use it) or is there a complete example of a Windows Form project that I can download?
thank you very much for your kind help !

Hi,

Could you give me more informations about the error you are getting ?
The best would be to share with me a sample code that can reproduce the issue.
If you are not confortable with sharing code here, you can send a email to support@stereolabs.com instead.
Also, could you give me the ZED SDK version you are using please ?

Unfortunately, we don’t have sample of code using Windows Form to share.

Best regards,
Benjamin Vallon

Hi Benjamin and thanks for your support;
just this morning I found that the problem was related to an error in the application compilation parameters in VS2019; I indicated as target platform AnyCPU instead of x64 and that caused the problem I reported.
Thank you very much and sorry for this ticket.
Antonio