views:

109

answers:

1

I am following this guide to installing and using MSpec, but at the step where he runs MSpec for the first time, I get the following error:

Could not load file or assembly 'file:///[...]\Nehemiah\Nehemiah.Specs\bin\Debug\Nehemiah.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 have - to my knowledge - done everything more or less exactly like he did up to this step, except where differences arise because he's using VS2008 and I'm using VS2010, and everything has worked so far. The project Nehemijah.Specs (and the entire solution) builds without problem, both in Visual Studio and on my build server, and I can't find anything useful in Event Viewer (although I might not be looking in the right place here...)

What to do?

+1  A: 

It appears you're compiling the Nehemiah.Specs.dll assembly against the .NET Framework 4. In order to run your specifications you need the .NET 4 build of MSpec which contains a console runner (mspec.exe) that is suitable for this version of the framework. You can find the a zip file containing the build on CodeBetter's CI server.

Other possibilities of running .NET 4 spec assemblies are

  • TestDriven.Net 3.0
  • ReSharper 5.0

Runners for both tools are also included in the distribution.

Alexander Groß
Sorry for the double post, I received an nginx error on my first post.
Alexander Groß
On a related note after reading the blog post: You don't need to run `InstallTDNetRunner.bat` when you run TD.Net >= 2.24. The NUnit installation is not needed as well. Doesn't hurt if it's there, but MSpec doesn't use NUnit.
Alexander Groß
Thanks for the reply! I have installed TD.NET 2.24 (the latest RTM release) and since I never got the InstallTDNetRunner.bat script working anyway, I haven't run it. mspec.exe is included in the build I downloaded, and I have configured VS2010 to run it using the configuration options suggested in the blog post. I also removed the reference to NUnit. However, I still get exactly the same error.
Tomas Lycken
Update: I checked the version of the assembly I had referenced, and as you said - it was the .net 2 version. I downloaded and referenced the .net 4 assembly, and now I instead get error "Missing assembly: -html" when I run the MSpec tool.
Tomas Lycken
Solved it! I was missing an "-" in my command line arguments. It should be "--html", but I had "-html". Thanks a lot for your help!
Tomas Lycken
Glad you got it working!
Alexander Groß