Search code examples
visual-studiospecflowtest-explorerfeature-file

I cannot get specflow's code behind files to regenerate


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:

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

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.

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.


Solution

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

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