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

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

Open TroyPalmerNZ opened this issue 2 years ago • 12 comments

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

TroyPalmerNZ avatar Jan 16 '23 03:01 TroyPalmerNZ

Facing the same issue

deepanshuverma avatar Jan 19 '23 16:01 deepanshuverma

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.

Cindi-QA avatar Feb 27 '23 14:02 Cindi-QA

Facing the same issue

psalters avatar Mar 20 '23 10:03 psalters

Me too, same issue. Could someone help us?

klaiddias avatar Mar 23 '23 13:03 klaiddias

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.

jared-bialkowski1 avatar Mar 24 '23 04:03 jared-bialkowski1

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.

klaiddias avatar Mar 24 '23 09:03 klaiddias

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

jared-bialkowski1 avatar Mar 27 '23 04:03 jared-bialkowski1

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

  • Visual Studio warning: The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled.

  • Visual Studio Build output: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

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

glautrou avatar Dec 21 '23 10:12 glautrou

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

HannaOstapenko95 avatar Mar 03 '24 12:03 HannaOstapenko95

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

Ellen-Lippe avatar Mar 15 '24 10:03 Ellen-Lippe

Thanks - saved my day!

akvam avatar Jun 06 '24 18:06 akvam

Just want to add this can also be caused by the BeforeFeature or AfterFeature functions being non-static

c-teixeira avatar Aug 30 '24 21:08 c-teixeira