SpecFlow Visual Studio extension attempted to use SpecFlow code-behind generator 1.9
Asked Answered
R

5

6

I am getting the following error while trying to build my automation solution. Due to which i am unable to change anything in my feature file at the moment.

error Version conflict - SpecFlow Visual Studio extension attempted to use SpecFlow code-behind generator 1.9, but project 'POC.Specs' references SpecFlow 2.0.

error We recommend migrating to MSBuild code-behind generation to resolve this issue.

error For more information see https://specflow.org/documentation/Generate-Tests-from-MsBuild/

.net version 4.6.2 Specflow 2.0.0 TestStack White Visual Studio 2015

I have tried reinstalling specflow 2.0.0 but still the same issue persists

Any help would be really appreciated.

Riboflavin answered 7/6, 2019 at 22:41 Comment(0)
H
4

The following steps resolved the issue for me:-

Try Step 3 first to resolve the problem. If that doesnt do the trick, go from Step 1 onwards.

  1. Add the NuGet package SpecFlow.Tools.MsBuild.Generation with the same version as SpecFlow to your project.
  2. Remove all SpecFlowSingleFileGenerator custom tool entries from your feature files.(go to the file properties and delete the value for custom tool)
  3. Select Tools | Options | SpecFlow from the menu in Visual Studio, and set Enable SpecFlowSingleFileGenerator CustomTool to "false".

refer link

Hillary answered 13/6, 2019 at 10:14 Comment(0)
H
1

This issue did my head in. Basically the fix was simple. My specflow extension was modified to specflow 3.0 changes and this issue that I was getting was for a project on specflow 2.4.1 The steps that I did to fix was simple.

  1. Reverted back the changes done to specflow extension. Eg: Tools->options->specflow and reverted back Enable Specflowsinglefilegenrator to True
  2. Cleared Nuget cache.
  3. Deleted the package folder.
  4. Upgraded/Freshly installed Nunit latest.
  5. Upgraded/Freshly installed Nunit3TestAdapter.

Step 4 was the most important step.

Highclass answered 16/10, 2019 at 12:51 Comment(1)
We use MsTest adapter and it was enough to update to next version (not latest as in step 4) and then go back to previous version of specflow nuget. I could call it reinstall Specflow nuget.Promptitude
P
0

re-generate feature.cs files using 'run custom tool' command

Preponderant answered 2/11, 2021 at 11:56 Comment(0)
F
0

If you don't use nuget package for build, then you need to copy the tools from specflow nuget package to your bin folder, where the TechTalk.Specflow.dll is located.

There is an alternative Visual Studio 2019 extension "deveroom" where you can configure the generator tools path manually. That works for every Specflow version. https://marketplace.visualstudio.com/items?itemName=SpecSolutions.DeveroomVisualStudio2019

For Visual Studio 2022 there is the new extension Specflow.VS successor of "deveroom" https://github.com/SpecFlowOSS/SpecFlow.VS

Fibriform answered 30/8, 2022 at 9:37 Comment(0)
G
-2

Clear the error message in .cs file under the feature file and then rebuild the code

Growing answered 14/6, 2019 at 6:48 Comment(1)
That is not working. You have to save the feature file to generate the .cs file again - and then you see the same error messages.Fibriform

© 2022 - 2024 — McMap. All rights reserved.