How to fix System.BadImageFormatException in 64-bit OS?
If you try to refere a dll which has a file format which CLR does not support, you will get this exception. In 64 bit OS, this can happen due to dll is having some 32 bit parts (COM components etc.) and it is being loaded as a 64 bit module.
To avoid that, you need to do the following:
In Visual Studio, right click the project.
In project properties, go to 'Build' tab
In General section, select Platform target as x86 (default is 'Any CPU')