无法加载文件或程序集 TechTalk.SpecFlow,版本 =1.9.0.77

Could not load file or assembly TechTalk.SpecFlow, Version=1.9.0.77

我在 Visual Studio 2013 年尝试 BDD。我开始了一个全新的空白项目。我已经编写了功能文件和步骤定义。我使用 NugGet 包添加了 SpecFlow。它安装了 SpecFlow 版本 2.1.0 当我构建解决方案时,它正在寻找 SpecFlow 版本 1.9.0.77

当我在 NugGet 包中搜索 SpecFlow 时,只列出了 1 个。我安装了它,我相信它是最新版本 2.1.0 为什么解决方案要寻找旧版本的 1.9.0.77 ? 如果解决方案是安装 1.9.0.77,我该如何安装它以及我如何在 NugGet 中找到这个版本?

完整的错误跟踪是:

Custom tool error: Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified. E:\RL Fusion\projects\BDD\C# BDD\youtubetutorial2\specflowfirst\SpecflowFirst\SpecflowFirst\Features\GoogleSearch.feature   2   2   SpecflowFirst

谢谢,里亚兹

导入的是:

using Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.Assist;

Baseclass.Contrib.SpecFlow.Selenium.NUnit 仅适用于 SpecFlow 1.9.0。它声称它适用于 1.9 之后的版本,但这不是真的,因为我们更改了 SpecFlow 中的插件接口。 您是否想使用它,因为它能够在一种情况下针对多个浏览器进行测试?

如果是这样,请查看此示例 https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/SeleniumWebTest,它使用 SpecFlow+Runner 作为测试运行器。
如果您遵循它,您将拥有相同的功能,并且可以使用最新版本的 SpecFlow。


完全披露:我是 SpecFlow 和 SpecFlow+ 的开发者之一。