Tuesday, April 19, 2011

System.BadImageFormatException on a 64-bit machine

So you've used a Visual Studio Installer to build and deploy an application. You try to run in after you install the application and all that you get is a System.BadImageFormatException - what have you done wrong!!
Well turns out that you have to define what platform you are building the application for when you run the build (x86 or x64). You can specify this on the project properties under the build tab - PlatformTarget.