我已向项目添加了 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/