钻机:Win7 64bit,VS2010,MVC V2,Testdriven.net 3.0,Reshaper 5.0,MSPEC 0.3

我最近开始了一个新项目,并想使用MSPEC。

(1)复制机器。机器

当我尝试运行测试时,我会得到此错误:system.io.filenotfoundexception:无法加载文件或汇编'机器。

我不知道这个错误来自哪里。

VS2010菜单 - > Resharper->插件显示MSPEC插件。 VS2010菜单 - > resharper->选项 - >工具 - >单元测试还显示了MSPEC单元测试提供商,但是当我单击MSTest和Nunit时,它没有显示任何详细信息。

我找到了这个: http://marcinobel.com/index.php/mspec-bdd-installer/ 没有用。我也尝试了: http://eduncan911.com/blog/registering-mspec-runners-for-testrive-net-on-windows-x64.aspx 这也无效。现在,我担心我搞砸了我的注册表。

有指导吗?

完整错误:

测试'f:tests.otbradio.tasks.albumtaskssspecs.when_the_album_tasks_are_asked_asked_to_get_get_all.context'失败:无法加载文件或汇编'Machine.Specifications,版本= 0.3.0.0,= 0.3.0.0,文化=中性,publicKeytoken = Null'或它的依赖性。该系统找不到指定的文件。 system.io.io.filenotfoundException:无法加载文件或汇编'机器。规定,版本= 0.3.0.0,culture =中性,publickeytoken = null'或其依赖项之一。该系统找不到指定的文件。 File name: 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' at Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member) at TestDriven.TestRunner.AdaptorTestRunner.Run (iTestListener testListener,itracelistener tracelistener,字符串汇编,字符串tortpath)在testdriven.testrunner.testrunner.threadtestrunner.runner.run()上

有帮助吗?

解决方案

您不需要复制 Machine.Specifications.TDNetRunner.dll 在任何地方,只需将其放在您的项目中 tools 或者 lib 目录,即您保留项目的依赖关系。包含MSPEC测试的项目将参考 Machine.Specifications.dll 来自此目录。 testdriven.net> = 2.24只要能够拿起td.net跑步者 Machine.Specifications.dll.tdnet 位于同一目录中。一个例子,我喜欢如何组织我的 tools 可以找到目录 这里.

您的Resharper 5.0插件目录对我看起来不错。但是,我有用户报告说,当您解压缩MSPEC zip文件时(您可能是从中下载的 http://teamcity.codebetter.com)使用Explorer,Windows将提取的DLL标记为从Internet下载。

您能确保Windows不会阻止DLL <ReSharper 5.0>\bin\plugins 通过打开每个DLL的属性,然后在第一个属性页面上单击“解散”。如果未显示“解冻”按钮,则您的文件还可以。在这种情况下,请在此处发布,我们将了解如何使用MSPEC插件。

其他提示

更改任何DLL后,您应该清理项目 - 因此您在新项目中没有任何错误。

我也遇到了同样的问题,并通过克隆了Github(https://github.com/machine/machine/machine.specifications)的MSPEC副本来修复它。

然后,在“源”文件夹中,我在“ xxx source build build debug”中创建了“ machine.specifications.dll”的批处理文件之一(在我的情况下build-4.0-debug.cmd)。

我删除了对“旧” dll的引用,清理了我的项目,并用我在上一步中获得的新dll复制在旧的dll上,重建了,这是一个技巧。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top