I\'m currently working in the Visual Studio 2012 RC with a test project. I have included the following assemblies:
Check to make sure you don't have an older version of .Net 4.0 installed. If you downloaded either the 2010 VS beta or the 2012 VS beta, that can happen and then for some reason it will spool up the wrong one. Oh, and it would be a side-by-side install with the current .Net 4.0 . reference
This seems to be fixed in Visual Studio 2012 when it went RTM. No need to update config files
I've tested that in Visual Studio 2012 Update 4 and Visual Studio 2013 Update 1 RC and your code works flawlessly with the above mentioned code and assembly references and without updating the config file of the test runner. It is possible this was broken in a beta or release candidate of Visual Studio 2012, but if it was, it seems to be fixed now.
As Hans mentions you can update the .config
file for the vstest.executionengine.x86.exe.config
, but that changes the behavior for all test projects on your machine and needs to be applied to all people working on your project (and on a build server should you be using one). This should be a last resort!!