Upgrading to SpecFlow 3

  1. Ensure that you have the following NuGet packages installed (at the latest version):

    SpecFlow

    SpecFlow.NUnit

    SpecFlow.Tools.MsBuild.Generation

  2. Remove all SpecFlowSingleFileGenerator custom tool entries from your feature file

  3. Select Tools > Options > SpecFlow from the ribbon menu at the top of Visual Studio and set Enable SpecFlowSingleFileGenerator CustomTool option to false.

  4. Switch to the Folder View in Solution Explorer.

  5. Open the project file ToolsList.AcceptanceTests.csproj

  6. Add the following to the end of the file, just before the closing </project> tag:

    <Target Name="AfterUpdateFeatureFilesInProject">
        <!-- include any generated SpecFlow files in the compilation of the project if not included yet -->
        <ItemGroup>
            <Compile Include="**\*.feature.cs" Exclude="@(Compile)" />
        </ItemGroup>
    </Target>

  7. Switch back to Solution View in Solution Explorer.

  8. Right-click on the project and choose Reload Project.

  9. Then choose Build > Rebuild Solution from the ribbon menu at the top of Visual Studio.

  10. Then open Test Explorer and your Features should be present.