Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

aforge

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

like image 966
G droid Avatar asked May 12 '15 06:05

G droid


People also ask

How do I resolve system BadImageFormatException?

Solution 1 Usually this is related to the difference in 64bit and 32bit DLL builds and processes. Try compiling to 32bit by changing project properties/Build/Platform Target .

What is System BadImageFormatException?

This exception is thrown when the file format of a dynamic link library (. dll file) or an executable (.exe file) doesn't conform to the format that the common language runtime expects.


1 Answers

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

like image 56
Roberto Gata Avatar answered Oct 10 '22 03:10

Roberto Gata