我已经使用 NuGet 控制台安装了 SpecFlow,它说它安装正确:
Install-Package SpecFlow.NUnit
Attempting to resolve dependency 'SpecFlow'.
Attempting to resolve dependency 'NUnit (≥ 2.6)'.
'SpecFlow.NUnit 1.1.1' already installed.
Install-Package SpecFlow
'SpecFlow 1.9.0' already installed.
但是当我尝试构建时出现错误:
error CS0246: The type or namespace name 'TechTalk' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
此外,我没有获得用于创建步骤定义的上下文菜单。不过,SpecFlow 功能可作为项目类型使用,并且语法高亮显示适用于小 cucumber 文件。
那我错过了什么?
最佳答案
所以我知道这个问题很老,但我今天在尝试解决类似问题时遇到了它。以防万一其他人遇到此问题,这是我的解决方案,希望对您有所帮助。
我有六个项目,我尝试使用 nuget 添加 SpecFlow 2.1。两个成功了,四个没有在引用中显示 dll 并给出了关于(您是否缺少 using 指令或程序集引用?)的错误。在深入研究之后,我注意到两个成功的项目在其项目属性中以 .NET 4.5 为目标,而四个不成功的项目则以 .NET 4.0 为目标。我将它们全部更改为目标 4.5.2 和嘿-presto,通过 nuget 添加 specflow 工作正常。
如果有人遇到类似问题,检查您的项目属性可能值得一试。
https://stackoverflow.com/questions/27760966/
相关文章:
node.js - node.js mongodb 中的 db.getUser
inno-setup - 如何在 InnoSetup 中更改 {app} 变量
unity3d - 从屏幕空间到世界空间的屏幕宽度 Unity3D
python - pymssql : Inserting mutliple values into
java - Jersey : use @Inject in ResourceConfig
ruby-on-rails - 康康舞能力 : allow site admin with roli