I have recently switched my development environment from 32-bit to 64-bit by installing Windows Server 2008 64-bit and modify it to be used as workstation as described here http://www.win2008workstation.com/ and I'm really amazed with it’s performance.
I have faced the problem mentioned in the post title when I'm trying to run a web application included in one of our development solutions.
I have checked the project which has the DBHelper as it’s output and I’ve discovered that the project configured to target x86 platform and as I'm working with 64-bit it will have such ‘incorrect format’ error.
How to fix it:
Simply follow the steps below :
- open project properties window.
- select Build tab
- Change it to ‘Any CPU’
- Save your changes.
- Compile your project and run :)