views:

96

answers:

2

Greeting, currently we migrate our project to .net 4. also we use .nunit 2.5.5 with testdriven.net 3. I got this error, when I run tests.

Test 'TestCase1' failed: System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    at NetSpec.TestingExtensions.ShouldEqual(Object o, Object expected)
    at NetSpec.TestingExtensions.ShouldBe(Object o, Object expected)
    Personnel\CivilServant\SubCategorySpec.cs(37,0): at Azarakhsh.Domain.Test.Personnel.CivilServant.when_validate_a_subCategoey.should_have_code()

0 passed, 1 failed, 0 skipped, took 9.35 seconds (NUnit 2.5.5).
A: 

It looks like it's trying to use the build-in Visual Studio testing (MSTest) rather than NUnit. Did the upgrade by any chance add a project reference to this assembly?

David M
Test project dose not has any reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework
Nima
+1  A: 

It looks like NetSpec has a reference to the VS2008 version of the MSTest assembly (Microsoft.VisualStudio.QualityTools.UnitTestFramework). I'm guessing you don't have VS2008 installed on this machine.

What you could try is copying it from a machine that does have VS2008 installed. You'll find it here: \Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

If you place it in the same folder as NetSpec, it should be copied when you compile your test project.

jcansdale