문제

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).
도움이 되었습니까?

해결책

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.

다른 팁

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top