Brian Hvarregaard
Brian Hvarregaard

Reputation: 4209

WPF application fails with "bad image format"

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?

Upvotes: 1

Views: 356

Answers (1)

Jeremiah Morrill
Jeremiah Morrill

Reputation: 4268

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.

Upvotes: 2

Related Questions