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.
See more info here: http://www.hanselman.com/blog/BackToBasics32bitAnd64bitConfusionAroundX86AndX64AndTheNETFrameworkAndCLR.aspx
- 6/26/2009
- CristianGhe
I can't make the WCF host to treat my 32 compiled server.... still looking for a solution.. when will we have Edit and Continue in x64 ?
Had a problem when executing a dll and searched high and low on why it was erroring. I knew it wasn't a missing supporting DLL because the same DLL executed fine from a VB6 application. Recompiled the application targeting x86 and everything works great!
Thanks for the heads up Logan1337. Makes sense after thinking about it, but just assumed if ran ok under x64 that dlls would be fine. Not so! I also see why its taking so long for 64 bit apps to come out if you have to recompile every DLL to x64 as well.
- 8/13/2008
- Jcrowusa
- 3/16/2008
- chaiguy1337