SpecFlowOSS / SpecFlow.VS

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

Severity Code Description Project File Line Suppression State Warning The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. 0 #152

Open Jankita31 opened 6 months ago

Jankita31 commented 6 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

No response

Issue Description

Severity Code Description Project File Line Suppression State Warning The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. 0

Steps to Reproduce

Updated visual studio to latest version 17.8.3

Link to Repository Project

No response

HowardvanRooijen commented 6 months ago

I'm getting a similar error on a solution I've just upgraded to .NET 8.0

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:\_code\TestProject.Specs\bin\Debug\net8.0> C:\Program Files\dotnet\dotnet.exe exec C:\Users\%USERNAME%\AppData\Local\Microsoft\VisualStudio\17.0_e83960db\Extensions\zv3dykkk.xjn\Connectors\Generic-net7.0\specflow-vs.dll discovery C:\_code\TestProject.Specs\bin\Debug\net8.0\TestProject.Specs.dll C:\_code\TestProject.Specs\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.

specflow.json contains the following:

{
  "stepAssemblies": [
    { "assembly": "Corvus.Testing.SpecFlow" }
  ]
}

Visual Studio 17.8.4

HowardvanRooijen commented 6 months ago

Upgrading to the preview release: https://github.com/SpecFlowOSS/SpecFlow.VS/releases/tag/v2022.1.93-net8 fixes the issue

jtullos-bt commented 4 months ago

Upgrading to the preview release: https://github.com/SpecFlowOSS/SpecFlow.VS/releases/tag/v2022.1.93-net8 fixes the issue

The description of that is v2022.1.91 (.NET 8 support) rather than v2022.1.93. Is this live yet?