SpecFlow.VS icon indicating copy to clipboard operation
SpecFlow.VS copied to clipboard

Ambiguous steps displayed in Visual Studio 2022 when Specflow.Autofac higher than 3.9.58 is referenced

Open vikingkom opened this issue 2 years ago • 9 comments

SpecFlow Version

Ambiguous steps displayed in Visual Studio 2022 when Specflow.Autofac higher than 3.9.58 is referenced

Which test runner are you using?

NUnit

Test Runner Version Number

4.2.1

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Classic project format using <PackageReference> tags

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

No response

Issue Description

Same issue as https://github.com/SpecFlowOSS/SpecFlow.VS/issues/91

I suspect this block because it registers the assembly twice.

Steps to Reproduce

  1. Create an empty NUnit project.
  2. Use Visual Studio 2022 Specflow extension v2022.1.66
  3. PackageReferences: <PackageReference Include="SpecFlow.Autofac" Version="3.9.74" /> <PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
  4. Add feature file and generate step definitions.

image

Link to Repro Project

https://drive.google.com/file/d/1LRTVHFlPHKGIbwOzJsv_zGFHFocgT5aG/view

vikingkom avatar Jul 04 '22 15:07 vikingkom

We faced this problem as well.

Radamonas avatar Aug 31 '22 14:08 Radamonas

I had the same problem but could fix it by editing the Specflow.json file. We still had some 'assembly' items in there which are no longer valid. Using something like this will fix it { "$schema": "https://specflow.org/specflow-config.json", "ide": { "editor": { "gherkinFormat": { "indentDataTable": false, "indentExamples": true, "indentExamplesTable": false } } } }

lampie1973 avatar Jan 20 '23 06:01 lampie1973

Facing the same problem. It did not help to make specflow.json file look like the one proposed by @lampie1973

sergheizagaiciuc avatar Feb 14 '23 14:02 sergheizagaiciuc

Facing the same issue with xUnit and Specflow.Autofac

Spaier avatar Mar 15 '23 23:03 Spaier

I have the same issue, SpecFlow.Autfac 3.9.74 and v2022.1.91 of the extension, its making using Specflow painful

AndrewScott-Ingram avatar Apr 27 '23 15:04 AndrewScott-Ingram

Also if you use Autofac along with XUnit for some reason the Visual Studio extension tries to run the functions that create the Test Dependencies and depending on what you do on startup it makes the whole discovery process fail. This behavior doesn't happen on Rider but it's an issue for my team since some of my colleagues only have a license for Visual Studio.

Henriqueba210 avatar Apr 28 '23 10:04 Henriqueba210

Got it fixed removing SpecFlow.Autofac package. It will also remove such errors/warnings if you downgrade SpecFlow.Autofac and related packages versions.

arzion avatar Apr 30 '23 18:04 arzion

Any further update on the issue, still facing the same issue , please let us know if any alternative to resolve the same.

shivumm avatar Nov 09 '23 04:11 shivumm

Any update about this issue?

maoso avatar Feb 08 '24 13:02 maoso