tags:

views:

30

answers:

1

Hi, I have an application build on my x64 computer. It is now build for x86 but on windows XP machines (x86) it fails with the "bad image format". On all Vista and up OS, it runs perfectly on x64 platfomrms. I tracked the problem to my icon.

I removed the icon and now it runs fine, anyone got an idea of how on earth this could relate to anything?

+1  A: 

This error is basically telling you that a dll being loaded does not match the bitage (32 or 64) of the process. You could be loading up an assembly using native 64bit code, or it could be a single dll that is set to x64. You can use the corflags utility from the Visual Studio Command prompt to check what the .NET assembly bitage is set to.

Jeremiah Morrill
+1, @H4mm3rHead mentions an icon, which may be living in a 64bit DLL that he would need to recompile x86.
sixlettervariables
The problem disappeared when i removed the icon from the .exe assembly, not a x64 bit assembly problem
H4mm3rHead