There are a number of reasons when one gets the error from the title. Searching the web for this error, there are a lot articles where some solutions are provided.
This morning I also got this error but none of the solutions that I've found were the right one.
It looks like one of the projects that my main application was referring, was build on .NET 4.0 and the main application was build on .NET 4.0 client profile. Setting both projects to use the same framework, fixed the issue.