Using the MSpec Class in Visual Studio 2010 and .NET 4

I am a big fan of MSpec, so naturally I would like to use VS2010 right away. I have an MSpec runner that is defined as an external tool in Visual Studio so that it always displays as a toolbar item.

In any case, whenever I try to use the MSpec runner (mspec.exe) with the .NET 4.0 solution, I get the following error:

Could not load file or assembly 'file:///C:\Users\[SOMEUSER]\[SOME_FOLDERS]\bin\Debug\[PROJECT].Specs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

I can still run my specs with the Resharper 5 runner, so I don't have much drama, but I bother me to the end: þ

Do you guys know what the problem might be? Is there any solution other than recompiling the entire Mspec source code as a .NET 4.0 solution that I really don't want to do?

Thanks in advance.
Sergi

+6
visual-studio-2010 resharper mspec
source share
2 answers

Use the net4 branch, which contains a version of MSpec compatible with .NET 4.0. We are working on integrating these changes into MSpec-master.

http://github.com/agross/machine.specifications/tree/net4

Update: Current builds are available on the Codebetter TeamCity server (select guest login)

+6
source share

I fixed this problem by running tests using mspec-clr4.exe .

+7
source share

All Articles