SpecFlow.VS
SpecFlow.VS copied to clipboard
Ambiguous steps displayed in Visual Studio 2022 when Specflow.Autofac higher than 3.9.58 is referenced
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
- Create an empty NUnit project.
- Use Visual Studio 2022 Specflow extension v2022.1.66
- PackageReferences: <PackageReference Include="SpecFlow.Autofac" Version="3.9.74" /> <PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
- Add feature file and generate step definitions.
Link to Repro Project
https://drive.google.com/file/d/1LRTVHFlPHKGIbwOzJsv_zGFHFocgT5aG/view
We faced this problem as well.
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 } } } }
Facing the same problem. It did not help to make specflow.json file look like the one proposed by @lampie1973
Facing the same issue with xUnit and Specflow.Autofac
I have the same issue, SpecFlow.Autfac 3.9.74 and v2022.1.91 of the extension, its making using Specflow painful
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.
Got it fixed removing SpecFlow.Autofac package. It will also remove such errors/warnings if you downgrade SpecFlow.Autofac and related packages versions.
Any further update on the issue, still facing the same issue , please let us know if any alternative to resolve the same.
Any update about this issue?