【问题标题】:nunit with testdriven.net problem in .net 4.net 4 中带有 testdriven.net 问题的 nunit
【发布时间】:2010-06-09 11:20:31
【问题描述】:

您好, 目前我们将项目迁移到 .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).

【问题讨论】:

    标签: nunit .net-4.0 testdriven.net


    【解决方案1】:

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

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

    如果你把它和NetSpec放在同一个文件夹里,你应该在编译你的测试项目时复制它。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 测试项目没有对 Microsoft.VisualStudio.QualityTools.UnitTestFramework 的任何引用
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多