0

SpecFlow for VS 2022 2022.1.91.26832

Problem

Cannot navigate to code behind feature file steps.

Tried

  • delete the .vs file
  • delete %temp% files
  • delete autogenerated .cs files for .feature files.
  • close VS
  • re-open and rebuild
Info: OnSettingsInitialized: Project settings initialized: .NETCoreApp,Version=v8.0,SpecFlow:3.9.74 Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\git\engine-features-automation\BDTFeaturesAutomation\bin\Debug\net8.0> C:\Program Files\dotnet\dotnet.exe exec c:\users\guyl\appdata\local\microsoft\visualstudio\17.0_7ad9ef81\extensions\ypciabcb.3gp\Connectors\Generic-net7.0\specflow-vs.dll discovery C:\git\engine-features-automation\BDTFeaturesAutomation\bin\Debug\net8.0\BDTFeaturesAutomation.dll C:\git\engine-features-automation\BDTFeaturesAutomation\specflow.json 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, ReadOnlySpan`1 typeInstantiationContext, ReadOnlySpan`1 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, Func`3 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, Func`3 testAssemblyFactory) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Runner.cs:line 50 at SpecFlowConnector.Runner.<>c__DisplayClass4_0.<Run>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, Func`2 fn) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\FunctionalExtensions.cs:line 5 at SpecFlowConnector.Runner.Run(String[] args, Func`3 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. 
3
  • Which unit test provider are you using? Which .NET framework version are you using? Which version of the SpecFlow NuGet package are you using? Commented Oct 14, 2024 at 12:28
  • Have you tried repairing your Visual Studio installation? Commented Oct 16, 2024 at 13:28
  • Thanks, @GregBurghardt. Will try. .NET 8.0. SpecFlow for VS 2022, 2022.1.91.26832. Commented Oct 27, 2024 at 7:57

3 Answers 3

2

I ran into this recently at work and (short version), the answer was to download & use Reqnroll instead: https://marketplace.visualstudio.com/items?itemName=Reqnroll.ReqnrollForVisualStudio2022

According to their website (https://specflow.org/) SpecFlow won't be available after today, which I suspect was known well before this week, as for instance their GitHub issues got nuked some time ago, ex: https://github.com/SpecFlowOSS/SpecFlow/issues/2719#issuecomment-1934292742

Sign up to request clarification or add additional context in comments.

2 Comments

There was a release of SpecFlow extension that never made it to the marketplace, which was working and fully supports .NET 8. Unfortunately, the repo has now been taken down. We plan to move forward using Reqnroll.
The SpecFlow extension for Visual Studio has also been removed from the marketplace when I checked today.
0

I had the same issue. Rolling back from .NET 8 to .NET 6 fixed it for me.

Comments

0

I tried all options and nothing worked and then I installed Reqnroll extension for Visual Studio 2022 and disabled Specflow extension and it worked.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.