How to show SpecFlow feature files in VS2019 MacOS?

Problem: SpecFlow feature files in VisualStudio 2019 for macOS don’t show up in the solution explorer. Rebuild, Unload, and Reload do not help. It just shows the generated .cs file but not the features file.

Solution: It turns out it is a common problem and people are still looking for the answer. This is the workaround I found and so far it is working for me.  Right-click the project > Display Options > Show All Files

After that, I am able to see my feature file.

Setup SpecFlow in MacOS with VisualStudio 2019

I was excited when .NET finally released VisualStudio 2019 for macOS. So I installed it in order to be able to work with SpecFlow. Unfortunately, SpecFlow does not have a plugin for macOS.

After some search, I finally found there is a plugin for SpecFlow for macOS. It is just not officially built by the SpecFlow itself. 

Create a project in MacOS with VS2019:

  1. Create a new Project with type NUnit
  2. Choose the version of .NET core ( I chose 3.1)
  3. Set the project name and location

Install the SpecFlow extension

  1. Download the extension from in https://github.com/straighteight/SpecFlow-VS-Mac-Integration
  2. go to menu Visual Studio > Extension. 
  3. The extension manager will be displayed and then click the “Install from file”. It will install the SpecFlow extension.

Add SpecFlow NuGet packages to Project:

  1. Right-click the project > Manage Nuget Packages
  2. Type SpecFlow in the search bar
  3. Choose SpecFlow, SpecFlow NUnit, SpecFlow.Tools.MSBuild.Generation

Add Feature Files:

The only thing that I am missing here is the auto-generation of a step definition. The extension does not have that capability. Therefore, we need to make it ourselves.