# BadImageFormatException in stereolabs.zed running a Windows Forms application

**URL:** <https://community.stereolabs.com/t/badimageformatexception-in-stereolabs-zed-running-a-windows-forms-application/489>\
**Category:** Software\
**Tags:** windows\
**Created:** [September 17, 2021, 4:26pm UTC](https://community.stereolabs.com/t/badimageformatexception-in-stereolabs-zed-running-a-windows-forms-application/489 "2021-09-17T16:26:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ant2166](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@ant2166](https://community.stereolabs.com/u/ant2166)\
**Post date:** [September 17, 2021, 4:26pm UTC](https://community.stereolabs.com/t/badimageformatexception-in-stereolabs-zed-running-a-windows-forms-application/489/1 "2021-09-17T16:26:28Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [September 20, 2021, 9:41am UTC](https://community.stereolabs.com/t/badimageformatexception-in-stereolabs-zed-running-a-windows-forms-application/489/2 "2021-09-20T09:41:20Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![ant2166](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/ecae2f/32.png) [@ant2166](https://community.stereolabs.com/u/ant2166)\
**Post date:** [September 20, 2021, 2:58pm UTC](https://community.stereolabs.com/t/badimageformatexception-in-stereolabs-zed-running-a-windows-forms-application/489/3 "2021-09-20T14:58:22Z")

</div>

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
