Apr 10, 2014 10:16 PM|markfitzme|LINK
Usually this error "An attempt was made to load a program with incorrect format" comes from the app pool being configured for 64 bit only. If there's a 32-bit dll in there, even if your build target is 64-bit or any cpu, you'll get this error.
Go into the IIS manager, find the application location in IIS, select the "Basic Settings" from the right-hand side of the screen under "Actions" | "Edit Site". Look at the selected Application Pool.
Now go to the Application Pools tree in the IIS manager, find the application pool right click on the name to bring up the context menu. Select "Advanced Settings". In the section labelled "General" at the very top you'll see an option called "Enable
32-bit Applications". Set this to true. Hit Ok. You may want to start and re-start the application pool just to make sure it all works.