.net 4 中的 nunit 与 testdriven.net 问题
问候, 目前我们将项目迁移到 .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).
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 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 相同的文件夹中,则应在编译测试项目时复制它。
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.
看起来它正在尝试使用内置的 Visual Studio 测试 (MSTest) 而不是 NUnit。升级是否有机会添加对此程序集的项目引用?
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?