SpecFlowOSS / SpecFlow.VS

The next version of the Visual Studio extension for SpecFlow
MIT License
36 stars 10 forks source link

When a project is migrated from Visual Studio 2019 to 2022, Go to definition stops working for referenced project #144

Closed marhyno closed 8 months ago

marhyno commented 8 months ago

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

using MSTest

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

{ "$schema": "https://specflow.org/specflow-config.json", "language": { "feature": "en-US" }, "bindingCulture": { "name": "en-US" }, "stepAssemblies": [ { "assembly": "BindingsProject" } ], "generator": { "allowRowTests": false }, "runtime": { "missingOrPendingStepsOutcome": "Error", "stopAtFirstError": true }, "trace": { "traceTimings": true, "minTracedDuration": "0:0:0.1", "stepDefinitionSkeletonStyle": "RegexAttribute" } }

Issue Description

We have migrated to Visual Studio 2022 from Visual Studio 2019. Projects have not been updated. All of the projects are C# (.Net Core) and have GUID 9A19103F-16F7-4668-BE54-9A1E7A4F7556 and the SpecFlow cannot find references when I want to add bindings from a referenced project. It builds the project, it creates .feature.cs files and also I can see the tests in Test Explorer, but the "Go to definition" doesnt work. I found that if I create fresh project using Visual Studio 2022 (.Net Framework 4.8 DLL project) with GUID - FAE04EC0-301F-11D3-BF4B-00C04F79EFBC (Windows C#) it will work and the reference will work even if I reference a project created in VS 2019. I know its an Extension bug and we will need to fix it. Any ideas where ?

Steps to Reproduce

  1. use VS 2019
  2. create c# dll project, one with Features, second with Bindings.
  3. Create a reference using specflow.json file and using Dependencies - Project
  4. If the "Go to definition" works open VS 2022
  5. Open the same solution
  6. The reference will not work

Link to Repository Project

No response

marhyno commented 8 months ago

Fixed, the issue was that specflow.json was not in the project folder but in a separate folder so the extension did not work.