我无法在文件后面获取Specflow的代码以进行重新生成 [英] I cannot get specflow's code behind files to regenerate

查看:133
本文介绍了我无法在文件后面获取Specflow的代码以进行重新生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编辑 specflow 功能文件测试时,它不会更新代码隐藏文件. 当我尝试通过右键单击项目并选择'Regenerate Feature Files'手动重新生成代码隐藏文件时,出现错误:

When I edit a specflow feature file test, it doesn't update the code-behind file. When I try to manually regenerate the code-behind files by right-clicking the project and choosing 'Regenerate Feature Files' I get an error:

错误:在此系统上找不到自定义工具'specflowsinglefilegenerator'

Error: cannot find custom tool 'specflowsinglefilegenerator' on this system

我发现这通常意味着我没有安装Specflow Extension.但是,当我在Visual Studio中查看扩展和更新"时,可以看到已安装'Specflow for Visual Studio 2017'.

I've discovered that this usually means I don't have Specflow Extention installed. However, when I look in Extensions and Update in Visual studio I can see that 'Specflow for Visual Studio 2017' is installed.

如果有人知道我能做些什么,那将非常有帮助. 当我将存储库重新克隆到新文件夹时,此操作开始.

If anyone knows what I can do that would be very helpful. This started when I re-cloned the repository into a new folder.

我也尝试过清理和重建.关闭Visual Studio.卸载并重新安装Specflow Extension.从Visual Studio从2019切换到2017.重新启动计算机.更新规格流程.删除specflow缓存文件并强制文件重新生成. 我仍然没有更改代码隐藏文件.

I have also tried clean and rebuild. Closing visual studio. Uninstalling and reinstalling Specflow Extention. Switching from visual studio from 2019 to 2017. Restarting my computer. Updating specflow. Deleting the specflow cache file and forcing the files to regenerate. I still have no changes to the code-behind file.

推荐答案

在Visual Studio中,我选择:工具>选项> Specflow. 然后将启用SpecFlowSingleFileGenerator自定义工具"设置为True.

In Visual studio, I chose: Tools > Options > Specflow. Then set Enable SpecFlowSingleFileGenerator Custom Tool to True.

但是,这是一个旧设置,我想尝试找到一种使用MSBuild的方法.

This is a legacy setting, however, and I want to try and find a way to use MSBuild.

这篇关于我无法在文件后面获取Specflow的代码以进行重新生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆