Tried Visual Studio 2022 + SpecFlow?

Suman Tomer
2 min readApr 27, 2022

Error : The name ‘tagHelper’ does not exist in the current context.

  1. Download Visual Studio 2022.
  2. Open Visual Studio and install Extension “SpecFlow” for VS 2022 and close the Visual Studio to continue it installing it afterwards.

3. Open the Visual Studio and create a C# SpecFlow Project as shown below.

4. Name the project.

5. Specify the .NET framework and Test Framework.

6. Build the Solution as created.

Default SpecFlow solution.

7. You might see following error due to Specflow cs file generation bug in Specflow for Visual Studio 2022.
Error : The name ‘tagHelper’ does not exist in the current context.

8. You need to upgrade the SpecFlow version from by right clicking on package and Manage package option and then upgrade potential dependencies packages from updates tab for the SpecFlow Project.

9. Once, you have upgrade, rebuild your project and you should be able to see above error disappeared

10. You can comment out any exception throwing code in the StepDefinition-cs file and run you tests from Test Explorer.

11. Congratulation on your new SpecFlow Test project in Visual Studio.

Note: Once that issue is fixed by SpecFlow, you might not see the error mentioned. The name ‘tagHelper’ does not exist in the current context.

--

--

Suman Tomer

Test Automation, QA Engineer, Azure Cloud, Helping woman who wants to learn testing and join industries