SpecFlowOSS / SpecFlow.VS

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

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

Open Awukam opened 2 months ago

Awukam commented 2 months 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

{ "$schema": "https://specflow.org/specflow-config.json", "language": { "feature": "en" }, "plugins": [ { "name": "SpecFlow.xUnit", "type": "UnitTestProvider" } ], "stepAssemblies": [ { "assembly": "RadarLiveApiTest" } ] }

Issue Description

Info: CreateProjectScope: Initializing project: RadarLiveApiTest Info: OnSettingsInitialized: Project settings initialized: .NETCoreApp,Version=v8.0,SpecFlow:3.9.74 Info: AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features. Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\Work\RadarLive.CalculationService\RadarLiveApiTest\bin\Debug\net8.0> C:\Program Files\dotnet\dotnet.exe exec C:\Users\awuka4707\AppData\Local\Microsoft\VisualStudio\17.0_92047977\Extensions\jupvedwe.tv1\Connectors\Generic-net7.0\specflow-vs.dll discovery C:\Work\RadarLive.CalculationService\RadarLiveApiTest\bin\Debug\net8.0\RadarLiveApiTest.dll C:\Work\RadarLive.CalculationService\RadarLiveApiTest\specflow.json Exit code: Message: You must install or update .NET to run this application.

App: C:\Users\awuka4707\AppData\Local\Microsoft\VisualStudio\17.0_92047977\Extensions\jupvedwe.tv1\Connectors\Generic-net7.0\specflow-vs.dll Architecture: x64 Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64) .NET location: C:\Program Files\dotnet\

The following frameworks were found: 3.1.32 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 6.0.32 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 8.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Learn more: https://aka.ms/dotnet/app-launch-failed

To install missing framework, download: https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=win-x64&os=win10 Cannot deserialize: 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

  1. Setup Specflow in .NET 8
  2. Add a feature file and write a test scenario.
  3. Try to generate a step definition file
  4. Then you should see the about error.

Link to Repository Project

No response

benhegartysefe commented 2 months ago

I geta similar error... Warning: ShowProblem: User Notification: All steps have been defined in this file already. Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\src\dorc-vnext\src\Tests.Acceptance\bin\Debug\net8.0> C:\Program Files\dotnet\dotnet.exe exec C:\Users\bhegarty\AppData\Local\Microsoft\VisualStudio\17.0_c3bbdbbe\Extensions\cyhm5df2.anh\Connectors\Generic-net7.0\specflow-vs.dll discovery C:\src\dorc-vnext\src\Tests.Acceptance\bin\Debug\net8.0\Trading.DevOps.Tests.Acceptance.dll "" Exit code: 4 Message: 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. File name: 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.ModuleHandle.ResolveMethod(QCallModule module, Int32 methodToken, IntPtr typeInstArgs, Int32 typeInstCount, IntPtr methodInstArgs, Int32 methodInstCount) at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, ReadOnlySpan1 typeInstantiationContext, ReadOnlySpan1 methodInstantiationContext) at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.RuntimeType.GetMethodBase(RuntimeModule scope, Int32 typeMetadataToken) at System.Reflection.RuntimeCustomAttributeData..ctor(RuntimeModule scope, MetadataToken caCtorToken, ConstArray& blob) at System.Reflection.RuntimeCustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget) at SpecFlowConnector.ReflectionExecutor.Execute(DiscoveryOptions options, Func3 testAssemblyFactory, ILogger _log, IAnalyticsContainer analytics) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\ReflectionExecutor.cs:line 15 at SpecFlowConnector.Runner.ExecuteDiscovery(DiscoveryOptions options, Func3 testAssemblyFactory) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Runner.cs:line 50 at SpecFlowConnector.Runner.<>c__DisplayClass4_0.b__0(ConnectorOptions options) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Runner.cs:line 30 at FunctionalExtensions.Map[TSource,TResult](TSource this, Func2 fn) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\FunctionalExtensions.cs:line 5 at SpecFlowConnector.Runner.Run(String[] args, Func3 testAssemblyFactory) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Runner.cs:line 26 Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: D. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at SpecFlow.VisualStudio.Connectors.OutProcSpecFlowConnector.Deserialize(RunProcessResult result, Func`2 formatErrorMessage) 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.

Akilawani commented 1 month ago

Had the same error. Uninstalled Specflow for Visual Studio 2022 extension and reinstalled

dumitruceaicovschi commented 4 weeks ago

Same error, looks like SpecFlow.MsTest supports only .net 6.0 same msbuild

CricutMike commented 4 weeks ago

For anyone coming across this issue when looking for step binding navigation problems in .NET 8 SpecFlow projects, I found that you can use this release of the extension and step binding navigation will probably work again (it worked for me). Found via this issue.

GaryClarkElekta commented 2 weeks ago

I see exactly the same issue - it occured after we upgraded to dot net 8

GaryClarkElekta commented 2 weeks ago

For anyone coming across this issue when looking for step binding navigation problems in .NET 8 SpecFlow projects, I found that you can use this release of the extension and step binding navigation will probably work again (it worked for me). Found via this issue.

I have that installed and it does not fix the issue!

tbetts42 commented 2 weeks ago

@GaryClarkElekta Check the patch version that's installed. I also thought I had v2022.1.91. The version in the link provided above, is v2022.1.93-net8, which has a display name of v2022.1.91 (.NET 8 support).

I had to uninstall the extension within VS, then ran the new .vsix manually, and the issue went away.

GaryClarkElekta commented 2 weeks ago

@GaryClarkElekta Check the patch version that's installed. I also thought I had v2022.1.91. The version in the link provided above, is v2022.1.93-net8, which has a display name of v2022.1.91 (.NET 8 support).

I had to uninstall the extension within VS, then ran the new .vsix manually, and the issue went away.

The link did fix the issue however the installed version for me is now 2022.1.93.29730