I have been working on a multithreaded application and I have been running it on my desktop machine as I am building it out. Everything seems to be running smoothly so I decide that it is time to move it over to my dual quad core zeon box to see how well it will do in that scenario. At this point I am just gathering metrics. I create the installer and install it on the box and as soon as I runn the app I get the following error “BadImageFormat Exception”. Not quite sure whats going on, I surmised that it had something to do with the fact that my desktop is x86 and my servers are x64, Now I know I compiled it using “Any CPU”. Should work I would think. Well I was wrong. In order for it to run on the x64 box, I needed to actually compile it using “x86″ cpu selection.The issue was not so much the app itself as it was the 3rd party dll that I had referenced. If I removed it then all went well to a point (no work was really done). So if you run into this issue try out this solution and see if it helps.
-paul