I know this question was asked long before .NET 4.5, but I found that I was getting this error on VS2010 after installing .NET 4.5.
The "solution" (not the most useful, I know) is obviously to remove .NET 4.5. I assume / hope that at some point there will be an update for Visual Studio 2010 to solve this problem.
UPDATE
I had a similar error while trying to run tests that used TypeMock. To solve the problem, I opened my solution in Visual Studio and selected Test Test Test Settings. In the Test Parameters dialog box, I selected Hosts and switched it to Run Tests in a 64-bit process on a 64-bit machine.
Stephen Oberauer
source share