Error: An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll

G droid picture G droid · May 12, 2015 · Viewed 16.8k times · Source

New error popped up when I created new build configuration  for x86Target not setting to x86I am trying to capture the frames from a video stream and I am trying to use AForge library for that purpose. But when i try to call any of the API's of the library from my project it gives me the above error.

My research shows that it could be due to using 32 bit windows dll on x64 or vice-versa.But i have not been able to find out any AForge library package for 64 bit windows. I am using x64 windows7. Any links or suggestions that can help me to resolve this error will be really appreciated.enter image description here

Answer

Roberto Gata picture Roberto Gata · Dec 7, 2016

I have changed platform target to x86 and my program Successfully run on x86 and x64 systems. Thank you all for help. I have changed platform target to x86 and my program Successfully run on x86 and x64 systems More details. I have 5 project in the solution. Two project using framework 2.0 it is a base classes and other project and exe project using framework 4.0. Something change in the base project and solution good build but not running. Last release the project was two years old. I made new release but it is run. I was happy do fast fix with change project target on x86. But we are not found the cause this trouble