BadImageFormatException when loading 32 bit DLL, target is x86

From what I understand, an assembly specifically built for x86 and running in a 64-bit operating system can only load libraries built for x86 or a BadImageFormatException will be thrown. In a 64-bit OS, an assembly built for Any CPU or x64 will throw the same exception when trying to load an x86 library. So, … Read more

System.BadImageFormatException An attempt was made to load a program with an incorrect format

It’s possibly a 32 – 64 bits mismatch. If you’re running on a 64-bit OS, the Assembly RevitAPI may be compiled as 32-bit and your process as 64-bit or “Any CPU”. Or, the RevitAPI is compiled as 64-bit and your process is compiled as 32-bit or “Any CPU” and running on a 32-bit OS.

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I am pretty sure you’re having a 32-bit / 64-bit conflict. It sounds like your main project might be set to 32-bit while the class its referencing is set to 64-bit. Try looking at this SO question and this one too. Between the two of them, you should be able to figure out your problem.

“An attempt was made to load a program with an incorrect format” even when the platforms are the same

If you try to run 32-bit applications on IIS 7 (and/or 64-bit OS machine), you will get the same error. So, from the IIS 7, right click on the applications’ application pool and go to “advanced settings” and change “Enable 32-Bit Applications” to “TRUE”. Restart your website and it should work.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)