I was getting this error all the time when I was creating a Windows Form to do some kind of Sharepoint 2010 House keeping.
I found out that everything was caused because I was developing in 32bit instead of 64bit, so to sort it just go to:
1- Visual Studio
2- Right Click into your project and select Properties
3- Select Build
4- On Build go to "platform target" and select Any CPU
Ah! Don't forget to target your platform to 3.5 otherwise you will not be able to point Microsoft.Sharepoint.dll