Troubleshooting Exceptions: System.BadImageFormatException
A BadImageFormatException exception is thrown when the file image of a DLL or executable program is not valid.
- Make sure the file image is a valid managed assembly or module.
This exception is thrown when unmanaged code is passed to Load for loading.
For more information, Visual Basic users can see Troubleshooting Interoperability (Visual Basic).
- Make sure you have supplied a correct file path for the assembly.
If using a relative path, verify that the current directory is correct.