BadImageFormatException Class
The exception that is thrown when the file image of a DLL or an executable program is invalid.
The 64-bit .NET framework cannot load a 32-bit native dll (non-.NET dll). If you wrote the application yourself, you can try forcing it into 32-bit mode.
Howto force an application to run in 32-bit mode on x64 using Visual Studio 2005 and 2005 Express versions:
For C# Projects:
Right click the project in the solution explorer and open ‘properties’
Choose the Build tab
Set the Platform Target property to ‘X86’
For VB Projects:
Right click the project in the solution explorer and open ‘properties’
Choose the Compile tab
Press the Advanced Compile Options… button
Set the Target CPU property to ‘X86’
Express Editions:
The VB and C# Express products do not expose the Target property inside the development environment. You will need to carefully modify the project file using a text or XML editor.
Close the project and/or solution
Select Open File from the File menu
Navigate to the project directory, and highlight the project file
Press the Open button, the project file should open in the XML editor
Locate the first section and add the following line:
x86
Save the project file
Reopen the project and/or solution using Open Project/Solution from the File menu
Continue with development, debugging, and testing
I had to edit the project file since I’m using the Express version. Hope this helps someone!