SpecFlowOSS / SpecFlow.VS

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

The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. #123

Open TroyPalmerNZ opened 1 year ago

TroyPalmerNZ commented 1 year ago

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

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

No response

Issue Description

Updated version of SpecFlow for Visual Studio Extension to version 2022.1.91.26832 in Visual Studio 2022

SpecFlow Nuget package versions:

SpecFlow 3.9.74 SpecFlow.NUnit 3.9.74 SpecFlow.Tools.MsBuild.Generation 3.9.74

VS 2022 Version Info:

Microsoft Visual Studio Professional 2022 Version 17.2.6 VisualStudio.17.Release/17.2.6+32630.192 Microsoft .NET Framework Version 4.8.04084

Installed Version: Professional

Visual C++ 2022 00476-80000-00000-AA712 Microsoft Visual C++ 2022

ASP.NET and Web Tools 2019 17.2.393.26812 ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 17.2.393.26812 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.2.393.26812 Azure Functions and Web Jobs Tools

C# Tools 4.2.0-4.22281.5+8d3180e5f00d42f0f0295165f756f368f0cbfa44 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.22089.1 Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Dotfuscator Community Edition 6.5.0+76d4669002 PreEmptive Protection - Dotfuscator CE

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.2.1 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Python - Profiling support 17.0.22089.1 Profiling support for Python projects.

Python - VC Project Support 17.0.21344.1 Provides support for launching C++ projects with Python debugging enabled.

Python with Pylance 17.0.22089.1 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.0.0.2218101+885a343b00bcab620a90c1550c37dafd730ce984 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.0.62204.01010 Microsoft SQL Server Data Tools

TypeScript Tools 17.0.10418.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.2.0-4.22281.5+8d3180e5f00d42f0f0295165f756f368f0cbfa44 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.1.0-beta.22329.1+702b8e77f5fbfe21e6743324c1750503e02f182d Microsoft Visual F# Tools

Visual Studio Extension for SpecFlow 1.0 Visual Studio extension for working with SpecFlow projects and Gherkin feature files.

Since taking the update I am faced with the error "The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled."

The following warning is displayed

Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\temp\OnboardingModule\Onboarding\bin\Debug> C:\Program Files\dotnet\dotnet.exe exec C:\Users\PalmerT2\AppData\Local\Microsoft\VisualStudio\17.0_5b93c4c9\Extensions\jl2xr1ot.avh\Connectors\Generic-net6.0\specflow-vs.dll discovery C:\temp\OnboardingModule\Onboarding\bin\Debug\Framework.dll C:\temp\OnboardingModule\Onboarding\App.config Exit code: 0 Message: 'M' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. Method not found: 'Void System.Text.Json.JsonSerializerOptions.set_Encoder(System.Text.Encodings.Web.JavaScriptEncoder)'. Unable to deserialize discovery options: Method not found: 'Void System.Text.Json.JsonSerializerOptions.set_Encoder(System.Text.Encodings.Web.JavaScriptEncoder)'. ({ "assemblyFile": "C:\temp\OnboardingModule\Onboarding\bin\Debug\Framework.dll", "configFile": "C:\temp\OnboardingModule\Onboarding\App.config", "connectorFolder": "C:\Users\PalmerT2\AppData\Local\Microsoft\VisualStudio\17.0_5b93c4c9\Extensions\jl2xr1ot.avh\Connectors\Generic-net6.0" }) Error System.MissingMethodException: Method not found: 'Void System.Text.Json.JsonSerializerOptions.set_Encoder(System.Text.Encodings.Web.JavaScriptEncoder)'. at SpecFlowConnector.JsonSerialization.GetJsonSerializerSettings() at SpecFlowConnector.JsonSerialization.DeserializeDiscoveryOptions(String json, ILogger log) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\JsonSerialization.cs:line 55

DiscoveryOptions { DebugMode = False, AssemblyFile = C:\temp\OnboardingModule\Onboarding\bin\Debug\Framework.dll, ConfigFile = C:\temp\OnboardingModule\Onboarding\App.config, ConnectorFolder = C:\Users\PalmerT2\AppData\Local\Microsoft\VisualStudio\17.0_5b93c4c9\Extensions\jl2xr1ot.avh\Connectors\Generic-net6.0 } Loading C:\temp\OnboardingModule\Onboarding\bin\Debug\Framework.dll Framework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null loaded Microsoft.Extensions.DependencyModel.DependencyContext loaded Loading mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Loading System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Loading System.Runtime.Loader, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Loading System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Loading System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Loading System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Resolved with Microsoft.Extensions.DependencyModel.Resolution.PackageCompilationAssemblyResolver from C:\Users\PalmerT2.nuget\packages\System.Text.Encodings.Web\7.0.0\lib/net6.0/System.Text.Encodings.Web.dll Found runtime library:System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 Loading System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a System.Text.Json.JsonException: 'M' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. ---> System.Text.Json.JsonReaderException: 'M' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at SpecFlowConnector.JsonSerialization.DeserializeObjectRunnerResult(String json, ILogger log) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\JsonSerialization.cs:line 86 Warning: AndDiscoveryProviderSucceed: The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. Please check the error message above and report to https://github.com/SpecFlowOSS/SpecFlow.VS/issues if you cannot fix.

Steps to Reproduce

Took upgrade of Specflow for VS2022 Extension. Built project Observed warning.

Link to Repository Project

No response

deepanshuverma commented 1 year ago

Facing the same issue

Cindi-QA commented 1 year ago

Facing the same issue. Removed .vs file and also ran the command to remove the stepmap from the temp file. Still issue remains.

Update: Was able to fix by removing the MicroSoft SDK package from my project. I was not using that package so no other issues.

psalters commented 1 year ago

Facing the same issue

klaiddias commented 1 year ago

Me too, same issue. Could someone help us?

jared-bialkowski1 commented 1 year ago

I am facing the same problem. The documentation for set up is old: https://docs.specflow.org/projects/getting-started/en/latest/GettingStarted/Step3.html image

It is a blocker for me so I am starting to look for alternatives to SpecFlow.

klaiddias commented 1 year ago

I am facing the same problem. The documentation for set up is old: https://docs.specflow.org/projects/getting-started/en/latest/GettingStarted/Step3.html image

It is a blocker for me so I am starting to look for alternatives to SpecFlow.

Maybe I have to do the same, I'll also look for another solution to be able to run the integration tests.

jared-bialkowski1 commented 1 year ago

Ok, I've got a solution. The issue happened to me when I was adding new item to a project not the solution. When I added new project to the solution it worked fine. image

glautrou commented 7 months ago

Same problem for me with a "net8.0" project.

Same error after installing "System.Runtime" 4.3.1 NuGet package. It works after downgrading to "net7.0".

SpecFlow is not yet compatible with .NET 8 : #2726 and #146 Until the extension is fixed on the Marketplace (2022.1.93+), you can install the patch manuelly (no need to uninstal previous instalation): https://github.com/SpecFlowOSS/SpecFlow.VS/releases/tag/v2022.1.93-net8

HannaOstapenko95 commented 4 months ago

Thank you!! Installing [vsix] from link above resolved an issue!

Ellen-Lippe commented 4 months ago

Yey!!! Thank you sooo much :-) Solved the issue for me too

akvam commented 1 month ago

Thanks - saved my day!