【问题标题】:How to fix the CS0234 - Assembly Reference Missing如何修复 CS0234 - 缺少装配参考
【发布时间】:2019-08-24 19:22:01
【问题描述】:

我正在设置 SPECFLOW BDD 项目,当我构建我的项目时,出现以下错误:

在参考文件夹中:我有“nunit.framework”

严重性代码描述项目文件行抑制状态 错误 CS0234 命名空间“NUnit.Framework”中不存在类型或命名空间名称“TestFixtureSetUpAttributeAttribute”(您是否缺少程序集引用?) SpecFlow Project2 C:\Users\source\repos\SpecFlow Project2\SpecFlow Project2\TestFeature.feature 3 不适用

严重性代码描述项目文件行抑制状态 错误 CS0234 命名空间“NUnit.Framework”中不存在类型或命名空间名称“TestFixtureSetUpAttribute”(您是否缺少程序集引用?) SpecFlow Project2 C:\Users\source\repos\SpecFlow Project2\SpecFlow Project2\TestFeature.feature 3 不适用

严重性代码描述项目文件行抑制状态 错误 CS0234 命名空间“NUnit.Framework”中不存在类型或命名空间名称“TestFixtureTearDownAttributeAttribute”(您是否缺少程序集引用?) SpecFlow Project2 C:\Users\source\repos\SpecFlow Project2\SpecFlow Project2\TestFeature.feature 12 不适用

严重性代码描述项目文件行抑制状态 错误 CS0234 命名空间“NUnit.Framework”中不存在类型或命名空间名称“TestFixtureTearDownAttribute”(您是否缺少程序集引用?) SpecFlow Project2 C:\Users\source\repos\SpecFlow Project2\SpecFlow Project2\TestFeature.feature 12 不适用

【问题讨论】:

  • 你引用的是哪个版本的 NUnit?

标签: visual-studio nunit specflow


【解决方案1】:

SpecFlow 扩展找不到引用的 SpecFlow 版本并回退到集成生成器(即 1.9...)。

解决方案:使用 MSBuild 生成:https://specflow.org/2019/generating-code-behind-files-using-msbuild/

【讨论】:

    猜你喜欢
    • 2014-12-30
    • 2011-07-01
    • 1970-01-01
    • 2013-08-03
    • 1970-01-01
    • 2019-06-30
    • 2020-09-28
    • 2011-08-21
    相关资源
    最近更新 更多