1

I get

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

exception when I compile my code in release, in debug all works fine.

Debug and release has the same configuration: main project was compiled in x86, some referenced projects in AnyCPU and my problem.dll in x86 too. I have to compile it in x86 becouse problem.dll use external 32 bit dlls.

How can I solve this problem?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
mantok
  • 75
  • 7
  • [1](http://stackoverflow.com/questions/2023766/an-attempt-was-made-to-load-a-program-with-an-incorrect-format-even-when-the-p) - [2](http://stackoverflow.com/questions/41449/i-get-a-an-attempt-was-made-to-load-a-program-with-an-incorrect-format-error-o) - [3](http://www.codeproject.com/Articles/110169/Fix-Error-An-attempt-was-made-to-load-a-program-wi) – Soner Gönül Apr 08 '13 at 11:42
  • 1
    Only in release it doesn't work in debug all work fine...and release and debug have the same configuration, so why in release does'nt work? – mantok Apr 08 '13 at 12:23
  • So you changed the Platform target on your EXE file to force it to run in 32-bit mode. For the Debug configuration. You'll have to do it again for the Release configuration. Use Build + Configuration Manager to switch. – Hans Passant Apr 08 '13 at 12:27
  • 1
    Debug and Release have the same compiler configuration, that's the problem! I don't understand why in release it doesn't works. – mantok Apr 08 '13 at 12:31
  • get rid of any of the `Any` - it's 32/64 issue – NSGaga-mostly-inactive Apr 08 '13 at 12:32
  • 1
    If i set all projects in x86 it doesn't work – mantok Apr 08 '13 at 13:00

0 Answers0