c# - 构建任意 Specflow 特征时出错

标签 c# specflow

我已向项目添加了 Specflow 功能,但该项目无法构建。

我收到的错误是:

Error 1 The type or namespace name 'CodeDom' does not exist in the namespace 'Absolute.Website.System' (are you missing an assembly reference?) C:\source\dot_net\BWO\src\Absolute.Website.System.Tests\test.feature.cs 17 13 Absolute.Website.System.Tests

Error 3 The type or namespace name 'Runtime' does not exist in the namespace 'Absolute.Website.System' (are you missing an assembly reference?) C:\source\dot_net\BWO\src\Absolute.Website.System.Tests\test.feature.cs 18 13 Absolute.Website.System.Tests

问题似乎出在自动生成的 test.feature.cs 文件中,其中包含以下两行:

[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.6.1.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

我添加了对系统程序集的引用,但无法找出可能导致构建错误的原因。有什么想法吗?

最佳答案

问题似乎是由于命名空间的名称采用 xxxx.System.yyyy 的形式造成的。当我重命名程序集时,问题是删除项目构建的 xxxx.System.yyyy 模式。

关于c# - 构建任意 Specflow 特征时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8063606/

相关文章:

c# - 为什么 BindNever 属性不起作用

c# - 有没有另一种方法来编写一个循环,使用 LINQ 从多个循环中进行选择?

c# - 我如何在 c# 中的特定字段值的结构数组上进行二进制搜索?

c# - 如何使用 Azure Devops Services Rest API 更新 Azure Devops 中测试用例的 "Area Path"

Specflow 生成上下文菜单中缺少的步骤定义

testing - 进行自动验收测试以测试字段是否保存到数据库是否重要?

visual-studio-2012 - 无法从 Visual Studio 2012 Ultimate Edition 运行 SpecFlow 场景

c# - 处理套接字/完成两次的问题?

c# - Linq order by aggregate in select { }

specflow - 是否可以以编程方式向场景添加行?