Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using MSpec runner in Visual Studio 2010 and .NET 4

I'm a big fan of MSpec so naturally I wanted to use is right away with VS2010 as well. I have the MSpec runner defined as an external tool in Visual Studio to be able to have it always visible as a toolbar item.

Anyway, whenever I try to use the MSpec runner (mspec.exe) with a .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 it's no big drama, but I bothers me to no end :þ

Do you guys have any idea what the problem could be? Is there any solution other than recompiling the whole Mspec source code as a .NET 4.0 solution, which I really, really don't want to do?

Thanks in advance.
Sergi

like image 332
Sergi Papaseit Avatar asked May 12 '10 08:05

Sergi Papaseit


2 Answers

I fixed this issue by running the tests with the mspec-clr4.exe instead.

like image 99
Dan Avatar answered Sep 18 '22 02:09

Dan


Use my net4 branch which contains a version of MSpec that is compatible with .NET 4.0. We're working on integrating these changes into MSpec's master.

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

Update: Current builds are available on Codebetter's TeamCity server (Choose guest login)

like image 34
Alexander Groß Avatar answered Sep 20 '22 02:09

Alexander Groß