Changes to the SpecFlow Visual Studio Extension

The Visual Studio extension has been updated for SpecFlow 3. The following is a summary of the changes.

Visual Studio 2019 Support

The latest version of the Visual Studio extension is compatible with Visual Studio 2019.

Legacy Single File Generator

We strongly recommend using the MSBuild integration to generate your code behind files. However, when you first install the new Visual Studio extension, it will be set to use the legacy code behind file generation method using SpecFlow’s single file generator.

To use the MSBuild integration, you need to disable this legacy support in the options in Visual Studio. To do so:

  1. Select Tools | Options from the menu in Visual Studio.
  2. Browse to SpecFlow | General in the list on the left (you can use the search field to restrict the options).
  3. Set Enable SpecFlowSingleFileGenerator CustomTool to false under Legacy.
  4. Click OK.

You also need to ensure that SpecFlowSingleFileGenerator is not entered in the Custom Tool field of your feature files.
Custom Tool

If you do not remove this entry, you will receive an error (“SpecFlow designer codebehind generation is not compatible with MSBuild codebehind generation. The custom tool must be removed from the file.”)

Context Menu Options Removed

The following options have been removed from the context menu:

  • Run SpecFlow Scenario
  • Debug SpecFlow Scenario

These options were removed due to the require APIs no longer being available, and due to these options being unreliable and causing a lot of issues.

Renaming Steps

Steps can now be renamed and the changes to the step name are propagated automatically to your code. Big thanks to slig3 for this contribution!

To rename a step:

  1. Open the feature file containing the step.
  2. Right-click on the step you want to rename and select Rename from the context menu.
  3. Enter the new text for the step in the dialog and confirm with OK.
  4. Your bindings and all feature files containing the step are updated.

Note: If the rename function is not affecting your feature files, you may need to restart Visual Studio to flush the cache.