运行 MSpec 时出错 - 如何排除故障?
我正在关注本指南 安装并使用MSpec,但是在他第一次运行MSpec的步骤中,我收到以下错误:
无法加载文件或程序集“file:///[...]\Nehemiah\Nehemiah.Specs\bin\Debug\Nehemiah.Specs.dll”或其依赖项之一。该程序集是由比当前加载的运行时更新的运行时构建的,无法加载。
据我所知,我所做的一切或多或少都与他在这一步中所做的完全一样,除了由于他使用 VS2008 而我使用 VS2010 而出现差异之外,到目前为止一切都有效。 Nehemijah.Specs 项目(以及整个解决方案)在 Visual Studio 和我的构建服务器上都可以毫无问题地构建,并且我在事件查看器中找不到任何有用的东西(尽管我可能没有在这里寻找正确的位置.. 。)
该怎么办?
I am following this guide to installing and using MSpec, but at the step where he runs MSpec for the first time, I get the following error:
Could not load file or assembly 'file:///[...]\Nehemiah\Nehemiah.Specs\bin\Debug\Nehemiah.Specs.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I have - to my knowledge - done everything more or less exactly like he did up to this step, except where differences arise because he's using VS2008 and I'm using VS2010, and everything has worked so far. The project Nehemijah.Specs (and the entire solution) builds without problem, both in Visual Studio and on my build server, and I can't find anything useful in Event Viewer (although I might not be looking in the right place here...)
What to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您正在针对 .NET Framework 4 编译
Nehemiah.Specs.dll
程序集。为了运行您的规范,您需要 .NET 4 版本的 MSpec,其中包含控制台运行程序 (mspec.exe
) 适合此版本的框架。您可以在 CodeBetter 的 CI 服务器。运行 .NET 4 规范程序集的其他可能性是
Runner,这两种工具也包含在发行版中。
It appears you're compiling the
Nehemiah.Specs.dll
assembly against the .NET Framework 4. In order to run your specifications you need the .NET 4 build of MSpec which contains a console runner (mspec.exe
) that is suitable for this version of the framework. You can find the a zip file containing the build on CodeBetter's CI server.Other possibilities of running .NET 4 spec assemblies are
Runners for both tools are also included in the distribution.