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. #141

Open Prabhu-Kumara opened 1 year ago

Prabhu-Kumara 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

{ "$schema": "http://schemas.specsolutions.eu/deveroom-config-latest-alpha.json",

"specFlow": { "isSpecFlowProject": true, "generatorFolder": "..\packages\Nav.3rdParty.SpecFlow.2.3.2\tools", "configFilePath": "specflow.json", "version": "2.3.2", "traits": [ "MsBuildGeneration", "DesignTimeFeatureFileGeneration" ] } }

Issue Description

VS version: vs2022 LTSC 17.6 Specflow version: 2.3.2 nunit version: 3.8.1 .net framework target version: 4.6.2

I had a specflow project working copy in vs 2017 and recently migrated to visual studio 2022 and when i build, i always get a error message saying The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. Is this a compatibility issues? Go to step definitions doesn't work and always get the below error (logs:)

logs: Info: OnActivityStarted: Starting Visual Studio Extension... Info: CreateProjectScope: Initializing project: NavNav Info: OnSettingsInitialized: Project settings initialized: .NETFramework,Version=v4.6.2,SpecFlow:2.3.2,x64 Info: AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features. 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:\Github\SN-BDDautomation\NavNav..\Output\NavNavBDDTests> c:\vs2022\common7\ide\extensions\ongcgzja.sfp\Connectors\V1\specflow-vs.exe discovery C:\Github\SN-BDDautomation\NavNav..\Output\NavNavBDDTests\Nav.NavNav.NavNavBDDTests.dll C:\Github\SN-BDDautomation\NavNav\specflow.json Exit code: 4 Message: Exception in:SpecFlow.VisualStudio.SpecFlowConnector.Discovery.SpecFlowV22Discoverer Error: Exception has been thrown by the target of an invocation. -> Object reference not set to an instance of an object. Exception: System.Reflection.TargetInvocationException->System.NullReferenceException StackTrace: at TechTalk.SpecFlow.Configuration.JsonConfig.JsonConfigurationLoader.LoadJson(SpecFlowConfiguration specFlowConfiguration, String jsonContent) at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.CreateGlobalContainer(IRuntimeConfigurationProvider configurationProvider) at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at SpecFlow.VisualStudio.SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Type[] parameterTypes, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ReflectionExtensions.cs:line 27 at SpecFlow.VisualStudio.SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ReflectionExtensions.cs:line 8 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.RemotingBaseDiscoverer.GetBindingRegistry(Assembly testAssembly, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\RemotingBaseDiscoverer.cs:line 39 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.BaseDiscoverer.DiscoverInternal(Assembly testAssembly, String testAssemblyPath, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\Discovery\BaseDiscoverer.cs:line 52 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.RemotingBaseDiscoverer.Discover(String testAssemblyPath, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\RemotingBaseDiscoverer.cs:line 12 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.DiscoveryProcessor.Process() in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\DiscoveryProcessor.cs:line 16 at SpecFlow.VisualStudio.SpecFlowConnector.ConsoleRunner.EntryPoint(String[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ConsoleRunner.cs:line 31

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. Warning: ShowProblem: User Notification: In order to be able to run the SpecFlow scenarios as tests, you need to install the 'SpecFlow.Tools.MsBuild.Generation' NuGet package to the project. Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\Github\SN-BDDautomation\NavNav..\Output\NavNavBDDTests> c:\vs2022\common7\ide\extensions\ongcgzja.sfp\Connectors\V1\specflow-vs.exe discovery C:\Github\SN-BDDautomation\NavNav..\Output\NavNavBDDTests\Nav.NavNav.NavNavBDDTests.dll C:\Github\SN-BDDautomation\NavNav\specflow.json Exit code: 4 Message: Exception in:SpecFlow.VisualStudio.SpecFlowConnector.Discovery.SpecFlowV22Discoverer Error: Exception has been thrown by the target of an invocation. -> Object reference not set to an instance of an object. Exception: System.Reflection.TargetInvocationException->System.NullReferenceException StackTrace: at TechTalk.SpecFlow.Configuration.JsonConfig.JsonConfigurationLoader.LoadJson(SpecFlowConfiguration specFlowConfiguration, String jsonContent) at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.CreateGlobalContainer(IRuntimeConfigurationProvider configurationProvider) at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at SpecFlow.VisualStudio.SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Type[] parameterTypes, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ReflectionExtensions.cs:line 27 at SpecFlow.VisualStudio.SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ReflectionExtensions.cs:line 8 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.RemotingBaseDiscoverer.GetBindingRegistry(Assembly testAssembly, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\RemotingBaseDiscoverer.cs:line 39 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.BaseDiscoverer.DiscoverInternal(Assembly testAssembly, String testAssemblyPath, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\Discovery\BaseDiscoverer.cs:line 52 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.RemotingBaseDiscoverer.Discover(String testAssemblyPath, String configFilePath) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\RemotingBaseDiscoverer.cs:line 12 at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.DiscoveryProcessor.Process() in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V1\Discovery\DiscoveryProcessor.cs:line 16 at SpecFlow.VisualStudio.SpecFlowConnector.ConsoleRunner.EntryPoint(String[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ConsoleRunner.cs:line 31

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. Create a new project in vs2022
  2. set the target version as .net framework 4.6.2
  3. Use specflow version 2.3.2 and nunit 3.8.1
  4. create a sample specflow feature and build the solution

Link to Repository Project

No response