0

问候,目前我们将项目迁移到 .net 4。我们还将 .nunit 2.5.5 与 testdriven.net 3 一起使用。运行测试时出现此错误。

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).
4

2 回答 2

1

看起来 NetSpec 引用了 MSTest 程序集 (Microsoft.VisualStudio.QualityTools.UnitTestFramework) 的 VS2008 版本。我猜你这台机器上没有安装VS2008。

您可以尝试从安装了 VS2008 的机器上复制它。您可以在此处找到它:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

如果将它与 NetSpec 放在同一文件夹中,则应在编译测试项目时将其复制。

于 2010-06-11T17:53:59.743 回答
0

看起来它正在尝试使用内置的 Visual Studio 测试 (MSTest) 而不是 NUnit。升级是否偶然添加了对该程序集的项目引用?

于 2010-06-09T11:22:51.860 回答