SpecFlowOSS / SpecFlow.VS

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

Unable to jump to the step definition. No source location detected. #77

Open bastarnae opened 2 years ago

bastarnae commented 2 years 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

{
  "bindingCulture": {
    "language": "en-us"
  },
  "language": {
    "feature": "en-us"
  },
  "stepAssemblies": [
    {
      "assembly": "TestIXXFrameworkCore"
    },
    {
      "assembly": "TestIXXFrameworkFeatures"
    },
    {
      "assembly": "Tests.PXX2"
    },
    {
      "assembly": "SpecFlow.Assist.Dynamic"
    }
  ],
  "generator": {
    "allowDebugGeneratedFiles": false
  }
}

Issue Description

When selecting "Go to definition" (F12) from context menu on a gherkin sentence, the Visual Studio Extension for Specflow shows a warning prompt containing the message "Unable to jump to the step definition. No source location detected."

Tests are runnable and text appears to be colored (recognized by VSE for Specflow 2022).

This does not happen on VS2019 with Specflow Extension for VS 2019.

image

Info: CheckConfiguration: Configuration changed
Info: ThenImportStepDefinitions: 171 step definitions discovered for project Tests.PXX2
Warning: PerformJump: Cannot jump to Defined: [Then(I initialize action (.*))]: StepsProcessAndActions.ThenIInitializeAction(String): no source location
Warning: ShowProblem: User Notification: Unable to jump to the step definition. No source location detected.
2022-05-10T18:13:17.111+03:00, Verbose@1, ProjectSystemOnProjectsBuilt: Projects built or settings initialized
2022-05-10T18:13:17.111+03:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectSystemOnProjectsBuilt
2022-05-10T18:13:17.112+03:00, Verbose@65, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V14_H1926986238 in 1 iteration(s)
2022-05-10T18:13:18.815+03:00, Verbose@65, RunDiscovery: C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472>C:\Program Files\dotnet\dotnet.exe exec c:\users\xxx\appdata\local\microsoft\visualstudio\17.0_afe48a4d\extensions\35na5f0v.wfr\Connectors\Generic-net6.0\specflow-vs.dll discovery C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472\Tests.PXX2.dll C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\specflow.json
2022-05-10T18:13:18.818+03:00, Info@65, ThenImportStepDefinitions: 171 step definitions discovered for project Tests.PXX2
2022-05-10T18:13:18.818+03:00, Verbose@65, InvokeDiscoveryWithTimer: 171 step definitions discovered in 00:00:01.7065561
2022-05-10T18:13:18.865+03:00, Verbose@65, CalculateSourceLocationTrackingPositions: 3 tracking positions calculated
2022-05-10T18:13:18.865+03:00, Verbose@65, ProjectIsModified: Triggering parse by ProjectBindingRegistryCache(ProjectBindingRegistry_V15_H-2135078065 RanToCompletion) on deveroom:"@all
@RegresieS" V2 (r0)
2022-05-10T18:13:18.865+03:00, Verbose@65, Update: BindingRegistryCache is modified ProjectBindingRegistry_V14_H1926986238->ProjectBindingRegistry_V15_H-2135078065.
2022-05-10T18:13:18.865+03:00, Verbose@65, DisposeSourceLocationTrackingPositions: Tracking positions disposed on V14
2022-05-10T18:13:18.873+03:00, Verbose@48, Parse: Parsed buffer v2 in 7ms on thread 48
**2022-05-10T18:15:38.496+03:00, Verbose@1, InvokeCommand: Go To Step Definition
2022-05-10T18:15:38.496+03:00, Warning@1, PerformJump: Cannot jump to Defined: [Then(I initialize action (.*))]: StepsProcessAndActions.ThenIInitializeAction(String): no source location
2022-05-10T18:15:38.512+03:00, Warning@1, ShowProblem: User Notification: Unable to jump to the step definition. No source location detected.
2022-05-10T18:17:27.373+03:00, Verbose@1, Exec: 00:01:48.8765222 PreExec GoToStepDefinitionCommand handled:True in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 128
2022-05-10T18:17:27.373+03:00, Verbose@1, Exec: 00:01:48.8765523 PostExec GoToStepDefinitionCommand handled:False in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 140**

Steps to Reproduce

  1. Open Visual Studio 2022
  2. Build Solution
  3. Open a feature file
  4. Click on a sentence and select from the context menu "Go to definition" (F12)
  5. Notice the prompt that appears on screen with message "Unable to jump to the step definition. No source location detected."

.NET Framework 4.7.2 Nugets Nunit + Specflow up to date

Link to Repository Project

No response

Vic152 commented 2 years ago

Same here.

SabotageAndi commented 2 years ago

@gasparnagy could this be a problem with the new connector?

gasparnagy commented 2 years ago

@bastarnae @Vic152 A few questions:

  1. Does this issue appear for steps that are defined in one of the external assemblies (the ones that are listed in the stepAssemblies config)?
  2. Are these external assemblies provided as dlls (e.g. via NuGet package) or do you have them in the solution and provided as project reference?
  3. Was this working earlier with VS2022 (we released a bigger change on 5th May)? If you did not try before with VS2022, could you please try it with v2022.1.9? (You can try an earlier version by uninstalling the current version, close VS, download the vsix file from the link and double click on it. VS will automatically update it to the latest version after a VS restart, unless you uncheck the automatic updates checkbox).
  4. Could you please check that that the assemblies that contain the problematic step definitions have a PDB file next to them and that the compilation is in "Debug" mode (and not "Release")?
Vic152 commented 2 years ago

For me this happened when I used the "calculator" project. I even got it to run the tests but still no navigation. The VS22 installation was brand new. I posted few messages on Discord, it happened to be 06 May 2022.

I never tried it with anything else, starting new work project from zero.

gasparnagy commented 2 years ago

@Vic152 Could you please zip your project as-is (with the compiled assemblies as well in bin/debug folder) and attach to this ticket?

Vic152 commented 2 years ago

image image will attach zip now

Vic152 commented 2 years ago

calculator.zip for some reason it needs to be new comment...

Vic152 commented 2 years ago

@Vic152 Could you please zip your project as-is (with the compiled assemblies as well in bin/debug folder) and attach to this ticket?

In my case I cannot navigate with F12 but I do not get error.

gasparnagy commented 2 years ago

@Vic152 For me this works fine. In the error list, you have a message that might be related: image

Could you maybe try to make a rebuild and close VS and reopen VS?

Also could you please attach the log file at %localappdata%\SpecFlow\specflow-vs-20220512.log

Vic152 commented 2 years ago

log, will do the steps now to re-build

2022-05-12T15:05:37.684+01:00, Verbose@1, GetSafeMonitoringService: Monitoring service loaded 2022-05-12T15:05:37.691+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope... 2022-05-12T15:05:37.703+01:00, Verbose@1, .ctor: Creating IDE Scope 2022-05-12T15:05:37.711+01:00, Info@1, OnActivityStarted: Starting Visual Studio Extension... 2022-05-12T15:05:37.855+01:00, Info@1, CreateProjectScope: Initializing project: calculator 2022-05-12T15:05:38.014+01:00, Verbose@1, GetPackageReferences: Exception : System.Exception: Unexpected result from GetInstalledPackagesAsync: ProjectNotReady at SpecFlow.VisualStudio.VsUtils.<>c__DisplayClass37_0.<b__0>d.MoveNext() in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 528 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread() at SpecFlow.VisualStudio.VsUtils.GetInstalledNuGetPackages(IServiceProvider serviceProvider, String projectFullName) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 504 at SpecFlow.VisualStudio.ProjectSystem.VsProjectScope.GetPackageReferences() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsProjectScope.cs:line 94 2022-05-12T15:05:38.048+01:00, Info@1, StartRetryInitializeTimer: Project settings not available yet, retry in 5 seconds... 2022-05-12T15:05:38.055+01:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectScopeServicesExtensions.GetDiscoveryService 2022-05-12T15:05:38.068+01:00, Verbose@65, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V1_H in 1 iteration(s) 2022-05-12T15:05:38.083+01:00, Verbose@65, WhenProjectSettingsIsInitialized: Uninitialized project settings 2022-05-12T15:05:38.084+01:00, Verbose@65, InvokeDiscoveryWithTimer: 0 step definitions discovered in 00:00:00.0029498 2022-05-12T15:05:38.365+01:00, Verbose@51, Parse: Parsed buffer v2 in 301ms on thread 51 2022-05-12T15:05:38.649+01:00, Verbose@1, SolutionEventListenerOnLoaded: Solution loaded 2022-05-12T15:05:40.830+01:00, Verbose@1, RegisterMenuCommands: RegenerateAllFeatureFileCodeBehindCommand registered 2022-05-12T15:05:43.093+01:00, Info@1, OnSettingsInitialized: Project settings initialized: .NETCoreApp,Version=v6.0,SpecFlow:3.9.40 2022-05-12T15:05:43.094+01:00, Verbose@1, ProjectSystemOnProjectsBuilt: Projects built or settings initialized 2022-05-12T15:05:43.104+01:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectSystemOnProjectsBuilt 2022-05-12T15:05:43.110+01:00, Verbose@81, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V1_H in 1 iteration(s) 2022-05-12T15:05:43.112+01:00, Info@81, AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features. 2022-05-12T15:05:43.113+01:00, Verbose@81, InvokeDiscoveryWithTimer: 0 step definitions discovered in 00:00:00.0030524 2022-05-12T15:06:47.907+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:06:47.917+01:00, Verbose@1, Exec: 00:00:00.0179666 PreExec GoToStepDefinitionCommand handled:True in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 128 2022-05-12T15:06:47.917+01:00, Verbose@1, Exec: 00:00:00.0181695 PostExec GoToStepDefinitionCommand handled:False in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 140 2022-05-12T15:06:55.904+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:07.041+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:09.453+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:10.606+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:12.053+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:14.630+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:16.634+01:00, Verbose@1, DocumentEventsOnDocumentOpened: C:\Users\user\source\repos\calculator\StepDefinitions\CalculatorStepDefinitions.cs, Text 2022-05-12T15:07:19.092+01:00, Verbose@1, InvokeCommand: Go To Step Definition 2022-05-12T15:07:23.790+01:00, Verbose@1, InvokeCommand: Go To Step Definition

Vic152 commented 2 years ago

after doing the re-build

2022-05-12T15:09:44.944+01:00, Verbose@1, OnBuildComplete: Firing BuildCompleted event... 2022-05-12T15:09:44.946+01:00, Verbose@1, CheckConfiguration: Checking configuration... 2022-05-12T15:09:44.953+01:00, Verbose@1, ProjectSystemOnProjectsBuilt: Projects built or settings initialized 2022-05-12T15:09:44.953+01:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectSystemOnProjectsBuilt 2022-05-12T15:09:44.954+01:00, Verbose@40, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V1_H in 1 iteration(s) 2022-05-12T15:09:44.954+01:00, Info@40, AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features. 2022-05-12T15:09:44.954+01:00, Verbose@40, InvokeDiscoveryWithTimer: 0 step definitions discovered in 00:00:00.0000487

Vic152 commented 2 years ago

after reopening after re-build

2022-05-12T15:10:47.979+01:00, Verbose@1, GetSafeMonitoringService: Monitoring service loaded 2022-05-12T15:10:47.986+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope... 2022-05-12T15:10:48.000+01:00, Verbose@1, .ctor: Creating IDE Scope 2022-05-12T15:10:48.012+01:00, Info@1, OnActivityStarted: Starting Visual Studio Extension... 2022-05-12T15:10:48.045+01:00, Info@1, CreateProjectScope: Initializing project: calculator 2022-05-12T15:10:48.204+01:00, Verbose@1, GetPackageReferences: Exception : System.Exception: Unexpected result from GetInstalledPackagesAsync: ProjectNotReady at SpecFlow.VisualStudio.VsUtils.<>c__DisplayClass37_0.<b__0>d.MoveNext() in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 528 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread() at SpecFlow.VisualStudio.VsUtils.GetInstalledNuGetPackages(IServiceProvider serviceProvider, String projectFullName) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 504 at SpecFlow.VisualStudio.ProjectSystem.VsProjectScope.GetPackageReferences() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsProjectScope.cs:line 94 2022-05-12T15:10:48.237+01:00, Info@1, StartRetryInitializeTimer: Project settings not available yet, retry in 5 seconds... 2022-05-12T15:10:48.244+01:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectScopeServicesExtensions.GetDiscoveryService 2022-05-12T15:10:48.260+01:00, Verbose@55, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V1_H in 1 iteration(s) 2022-05-12T15:10:48.277+01:00, Verbose@55, WhenProjectSettingsIsInitialized: Uninitialized project settings 2022-05-12T15:10:48.278+01:00, Verbose@55, InvokeDiscoveryWithTimer: 0 step definitions discovered in 00:00:00.0030566 2022-05-12T15:10:48.409+01:00, Verbose@22, Parse: Parsed buffer v2 in 153ms on thread 22 2022-05-12T15:10:48.838+01:00, Verbose@1, SolutionEventListenerOnLoaded: Solution loaded 2022-05-12T15:10:53.260+01:00, Info@1, OnSettingsInitialized: Project settings initialized: .NETCoreApp,Version=v6.0,SpecFlow:3.9.40 2022-05-12T15:10:53.260+01:00, Verbose@1, ProjectSystemOnProjectsBuilt: Projects built or settings initialized 2022-05-12T15:10:53.268+01:00, Verbose@1, TriggerDiscovery: Discovery triggered from ProjectSystemOnProjectsBuilt 2022-05-12T15:10:53.269+01:00, Verbose@54, GetThreadSafeRegistry: Got access to ProjectBindingRegistry_V1_H in 1 iteration(s) 2022-05-12T15:10:53.271+01:00, Info@54, AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features. 2022-05-12T15:10:53.272+01:00, Verbose@54, InvokeDiscoveryWithTimer: 0 step definitions discovered in 00:00:00.0030350 2022-05-12T15:10:54.739+01:00, Verbose@1, RegisterMenuCommands: RegenerateAllFeatureFileCodeBehindCommand registered

image

gasparnagy commented 2 years ago

@Vic152 That's strange... What is your exact Visual Studio version (displayed by the Help / About dialog)?

Vic152 commented 2 years ago

@Vic152 That's strange... What is your exact Visual Studio version (displayed by the Help / About dialog)?

image image

Vic152 commented 2 years ago

for reasons I also have these installations

image

gasparnagy commented 2 years ago

@Vic152 Thank you for your valuable help so far. Unfortunately I am still unable to reproduce the problem. There might be something in your setup that we don't see. (And unfortunately it might affect other users as well.)

If you are still interested to help, the next idea would be that you download, build and run the visual studio extension yourself and debug it through to see whether there are any hidden errors.

For that you need to first of all install the "Visual Studio extension development" workload in VS installer, that you can open by invoking "Tools / Get Tools and Features" from VS. Then open the SpecFlow.VS solution from the cloned repo, set the "SpecFlow.VisualStudio.Package" project as startup project, build and simply debug the project (F5). This will open the "experimental hive" of Visual Studio with the just compiled SpecFlow extension installed (the exp hive is independently configured from the normal VS). Open the "calculator" solution and see if you see any exception that might be related to the problem. You can also search in the code for the "Test assembly not found" error message, put a breakpoint there and see where it tries to find the assembly.

If you run into any trouble, I am happy to help.

Vic152 commented 2 years ago

I will try that, but first I will see if this happens with another user on another laptop ;)

Klarahov commented 2 years ago

I have seen the same "test assemblies not found" issue. Not for the project you sent though, but for another project I'm working on. https://github.com/SpecFlowOSS/SpecFlow.VS/issues/76

Vic152 commented 2 years ago

This is the log when I try to define steps

2022-05-16T10:39:37.164+01:00, Warning@1, ShowProblem: User Notification: All steps have been defined in this file already. 2022-05-16T10:39:39.259+01:00, Verbose@1, Exec: 00:00:02.0959009 PreExec DefineStepsCommand handled:True in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 128 2022-05-16T10:39:39.259+01:00, Verbose@1, Exec: 00:00:02.0959449 PostExec DefineStepsCommand handled:False in D:\a\1\s\SpecFlow.VisualStudio\Editor\Commands\Infrastructure\DeveroomEditorCommandBroker.cs: line 140

Vic152 commented 2 years ago

For calculator project I do not get numbers highlighted

image

Vic152 commented 2 years ago

I will try that, but first I will see if this happens with another user on another laptop ;)

I tried it on another laptop and it worked. It had problem before first build, but once it was build it ran. VS version was 17.0.4 My version od VS 2022 was 17.1.6

Vic152 commented 2 years ago

I tried:

  1. Removing bin and obj and restarting VS22
  2. Uninstalling and installing SpecFlow extension
  3. I updated VS22 to 17.2.0
  4. Downloading the repo from scratch
  5. I cleaned, restored and built solution in CLI and IDE several times

no joy

gasparnagy commented 2 years ago

@Vic152 Let's debug. If you want we can have a session together and try to debug it. I am available on Thursday or Friday.

Vic152 commented 2 years ago

@Vic152 Let's debug. If you want we can have a session together and try to debug it. I am available on Thursday or Friday.

Yeah sure. Andi should have my email. I will setup the dev env.

Vic152 commented 2 years ago

To add to the list I repaired the VS22 installation in case it was corrupted.

Vic152 commented 2 years ago

I started digging, this is the line that throw always when I load the solution

image

gasparnagy commented 2 years ago

For. NET core based projects the packages are not available immediately, so there is a retry logic after a few seconds. So this exception is not necessarily the root cause (but can be of course), try to continue and see if it comes again.

bastarnae commented 2 years ago

Sorry for the late reply.

Here are my findings based on the steps provided:

  1. Does this issue appear for steps that are defined in one of the external assemblies (the ones that are listed in the stepAssemblies config)?

Yes

  1. Are these external assemblies provided as dlls (e.g. via NuGet package) or do you have them in the solution and provided as project reference?

They are provided as project reference and the dll is generated on build.

  1. Was this working earlier with VS2022 (we released a bigger change on 5th May)? If you did not try before with VS2022, could you please try it with v2022.1.9? (You can try an earlier version by uninstalling the current version, close VS, download the vsix file from the link and double click on it. VS will automatically update it to the latest version after a VS restart, unless you uncheck the automatic updates checkbox).

Doing the steps got me these logs:

Info: OnActivityStarted: Starting Visual Studio Extension...
Info: CreateProjectScope: Initializing project: Tests.PXX2
Info: OnSettingsInitialized: Project settings initialized: .NETFramework,Version=v4.7.2,SpecFlow:3.9.74
Info: AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features.
Info: ThenImportStepDefinitions: 171 step definitions discovered for project Tests.PXX2
Warning: PerformJump: Cannot jump to Defined: [Then(I initialize action (.*))]: StepsProcessAndActions.ThenIInitializeAction(String): no source location
Warning: ShowProblem: User Notification: Unable to jump to the step definition. No source location detected.

At some point with this version of the specflow extension I had this exception:

Warning: AndDiscoveryProviderSucceed: Error during binding discovery. 
Command executed:
  C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472> C:\Program Files\dotnet\dotnet.exe exec C:\USERS\WXXX\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\17.0_AFE48A4D\EXTENSIONS\IOL4PEHS.JVO\Connectors\Generic-net6.0\specflow-vs.dll discovery C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472\Tests.PXX2.dll C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\specflow.json
Exit code: 0
Message: 
Info Found V3.9.74.14555 at C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472\TechTalk.SpecFlow.dll
Info Chosen BindingRegistryFactoryBeforeV310000 for 309074
Error System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'RecordSolution, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'RecordSolution, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
   at SpecFlowConnector.SpecFlowProxies.BindingAssemblyContextLoader.Load(String assemblyName) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingAssemblyContextLoader.cs:line 16
   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
   at TechTalk.SpecFlow.TestRunnerManager.GetBindingAssemblies()
   at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner)
   at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Type[] parameterTypes, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\ReflectionExtensions.cs:line 26
   at SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\ReflectionExtensions.cs:line 7
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryBeforeV310000.InvokeCreateTestRunner(TestRunnerManager testRunnerManager) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryBeforeV310000.cs:line 13
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateTestRunner(IObjectContainer globalContainer, Assembly testAssembly) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 62
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateTestRunner(Object globalContainer, Assembly testAssembly) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 55
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactory.<>c__DisplayClass2_0.<GetBindingRegistry>b__2(Object container) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 26
   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.SpecFlowProxies.BindingRegistryFactory.<>c__DisplayClass2_0.<GetBindingRegistry>b__0(Object dependencyProvider) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 17
   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.SpecFlowProxies.BindingRegistryFactory.GetBindingRegistry(AssemblyLoadContext assemblyLoadContext, Assembly testAssembly, Option`1 configFile) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 16
   at SpecFlowConnector.Discovery.SpecFlowDiscoverer.Discover(IBindingRegistryFactory bindingRegistryFactory, AssemblyLoadContext assemblyLoadContext, Assembly testAssembly, Option`1 configFile) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\SpecFlowDiscoverer.cs:line 24
   at SpecFlowConnector.Discovery.DiscoveryCommand.<>c__DisplayClass6_0.<Execute>b__0(IBindingRegistryFactory bindingRegistryFactory) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\DiscoveryCommand.cs:line 27
   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.Discovery.DiscoveryCommand.Execute(AssemblyLoadContext assemblyLoadContext) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\DiscoveryCommand.cs:line 25
   at SpecFlowConnector.ReflectionExecutor.<>c__DisplayClass3_0.<Execute>b__5(DiscoveryCommand cmd) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\ReflectionExecutor.cs:line 71
   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.ReflectionExecutor.<>c__DisplayClass3_1.<Execute>b__1() in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\ReflectionExecutor.cs:line 69
   at EitherAdapters.Try[T](Func`1 act) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\Either\EitherAdapters.cs:line 40
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: AndDiscoveryProviderSucceed: Error during binding discovery. 
Command executed:
  C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472> C:\Program Files\dotnet\dotnet.exe exec C:\USERS\XXX\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\17.0_AFE48A4D\EXTENSIONS\IOL4PEHS.JVO\Connectors\Generic-net6.0\specflow-vs.dll discovery C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472\Tests.PXX2.dll C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\specflow.json
Exit code: 0
Message: 
Info Found V3.9.74.14555 at C:\repo_playground\P16010-poc-Speckflow\TestIXXFramework\Tests.PXX2\bin\net472\TechTalk.SpecFlow.dll
Info Chosen BindingRegistryFactoryBeforeV310000 for 309074
Error System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'RecordSolution, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'RecordSolution, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.InternalLoad(ObjectHandleOnStack assemblyName, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Boolean throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, RuntimeAssembly requestingAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
   at SpecFlowConnector.SpecFlowProxies.BindingAssemblyContextLoader.Load(String assemblyName) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingAssemblyContextLoader.cs:line 16
   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
   at TechTalk.SpecFlow.TestRunnerManager.GetBindingAssemblies()
   at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner)
   at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Type[] parameterTypes, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\ReflectionExtensions.cs:line 26
   at SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Object[] args) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\ReflectionExtensions.cs:line 7
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryBeforeV310000.InvokeCreateTestRunner(TestRunnerManager testRunnerManager) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryBeforeV310000.cs:line 13
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateTestRunner(IObjectContainer globalContainer, Assembly testAssembly) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 62
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateTestRunner(Object globalContainer, Assembly testAssembly) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 55
   at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactory.<>c__DisplayClass2_0.<GetBindingRegistry>b__2(Object container) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 26
   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.SpecFlowProxies.BindingRegistryFactory.<>c__DisplayClass2_0.<GetBindingRegistry>b__0(Object dependencyProvider) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 17
   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.SpecFlowProxies.BindingRegistryFactory.GetBindingRegistry(AssemblyLoadContext assemblyLoadContext, Assembly testAssembly, Option`1 configFile) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactory.cs:line 16
   at SpecFlowConnector.Discovery.SpecFlowDiscoverer.Discover(IBindingRegistryFactory bindingRegistryFactory, AssemblyLoadContext assemblyLoadContext, Assembly testAssembly, Option`1 configFile) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\SpecFlowDiscoverer.cs:line 24
   at SpecFlowConnector.Discovery.DiscoveryCommand.<>c__DisplayClass6_0.<Execute>b__0(IBindingRegistryFactory bindingRegistryFactory) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\DiscoveryCommand.cs:line 27
   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.Discovery.DiscoveryCommand.Execute(AssemblyLoadContext assemblyLoadContext) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\Discovery\DiscoveryCommand.cs:line 25
   at SpecFlowConnector.ReflectionExecutor.<>c__DisplayClass3_0.<Execute>b__5(DiscoveryCommand cmd) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\ReflectionExecutor.cs:line 71
   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.ReflectionExecutor.<>c__DisplayClass3_1.<Execute>b__1() in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\ReflectionExecutor.cs:line 69
   at EitherAdapters.Try[T](Func`1 act) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\NetExtensions\Either\EitherAdapters.cs:line 40
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: PerformJump: Cannot jump to Defined: [When(I set form parameters(.*))]: StepsParametersAndForms.ThenISetFormParameters(String, Table): no source location
Warning: ShowProblem: User Notification: Unable to jump to the step definition. No source location detected.
Info: CheckConfiguration: Configuration changed
Info: AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the SpecFlow Visual Studio Extension features.
Warning: PerformJump: Cannot jump to Defined: [Then(I initialize action (.*))]: StepsProcessAndActions.ThenIInitializeAction(String): no source location
Warning: ShowProblem: User Notification: Unable to jump to the step definition. No source location detected.
Info: ThenImportStepDefinitions: 171 step definitions discovered for project Tests.PXX2
  1. Could you please check that that the assemblies that contain the problematic step definitions have a PDB file next to them and that the compilation is in "Debug" mode (and not "Release")?

Yes, the compilation is in "Debug" mode.
image

Yes, the assemblies have a .pdb file created.

bastarnae commented 2 years ago

@gasparnagy is the information provided sufficient?

bastarnae commented 2 years ago

@gasparnagy ; @SabotageAndi

Hello, do you have any update regarding this issue? Thank you!

bastarnae commented 2 years ago

@gasparnagy @SabotageAndi

Hello, I have found the culprit of the issue in the solution. I have postsharp installed and in my assembly there is a TestXFrameworkFeatures.psproj

This psproj contains:

<?xml version="1.0" encodX="utf-8" ?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration">
  <Multicast xmlns:my="clr-namespace:TestXFrameworkFeatures.Aspects;assembly:TestXFrameworkFeatures">
    <my:ExecutionTimeAspect AttributeTargetAssemblies="Platform.Client" AttributeTargetTypes="Platform.Client.OpenAPI.*" />
    <my:MethodInterceptor AttributeTargetAssemblies="TestXFrameworkCore" AttributeTargetTypes="TestXFrameworkCore.CoreAPI.*" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsParametersAndForms" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsProcessAndActions" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsFileImporter" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsDatabaseOperations" />
    <my:UpdateTableAspect AttributeExclude="True" AttributeTargetTypes="TestXFrameworkFeatures.BindXs" />
  </Multicast>
</Project>

When below lines are commented:

    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsParametersAndForms" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsProcessAndActions" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsFileImporter" />
    <my:UpdateTableAspect AttributeTargetAssemblies="TestXFrameworkFeatures" AttributeTargetTypes="TestXFrameworkFeatures.StepsDatabaseOperations" />

I'm able to jump to definitions without a problem, but other issue arise and test fails. If I uncomment, I'm unable to jump but the test passes.

I'm using latest versions of all extensions.

Is this related to specflow? How can I further debug what is actually happening.

Thanks!

saiparth commented 1 year ago

I am also facing the same issue. Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.4.3 The steps are referenced via stepAssembly in config. Not able to navigate inside to step definition. I had VS 2019 also, Uninstalled it and still same issue. clearing temp files, restart.. nothing helped.

saiparth commented 1 year ago

It was due to AOP library that we used, after modifying to invoke after method, its working

gasparnagy commented 1 year ago

@saiparth Thx for the update.

bastarnae commented 1 year ago

@gasparnagy in previous SpecFlow versions (2017-2019) this behavior was not present when a public virtual void OnInvoke( MethodInterceptionArgs args ) was used. More info here: https://doc.postsharp.net/m_postsharp_aspects_methodinterceptionaspect_oninvoke_5ba43ce6

We are using OnInvoke method the overwrite TechTalk.Specflow.Table with our desired values, but this is triggering the "Unable to jump to the step definition. No source location detected." when we want to debug Gherkin sentences.

OnEntry does not work in this case as the instance is changed and the table is read-only..hence any modifications done are not overwritten but we regain the functionality of the Gherkin jump-to-step definition. More info here: https://doc.postsharp.net/m_postsharp_aspects_onmethodboundaryaspect_onentry_f7d2c910

Overall the functionality of Method Interception with PostSharp has been lost with the new SpecFlow. https://doc.postsharp.net/method-interception

@gasparnagy @SabotageAndi will this be fixed or shall we rebuild our Framework differently?

Thank you, Eugen

hatefi-arman commented 1 year ago

Hi, I am using VS 2022 Professional - Version 17.5.3 (recently installed) and installed SpecFlow extension 2022.1.91.26832 image

I see error "'M' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0." and "Warning: AndDiscoveryProviderSucceed: The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled. " in output window and it cannot show "Go to step definition" option in context menu. Would you please help? Here is the output log: `Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: [My_Dev_Path]> C:\Program Files\dotnet\dotnet.exe exec C:\Users[UserName]\AppData\Local\Microsoft\VisualStudio\17.0_ba1beff7\Extensions\vm1rsne4.fcd\Connectors\Generic-net6.0\specflow-vs.dll discovery [My_Dev_Path]\bin*Test.dll "" 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": "[My_Dev_Path]**Test.dll", "connectorFolder": "C:\Users\[UserName]\AppData\Local\Microsoft\VisualStudio\17.0_ba1beff7\Extensions\vm1rsne4.fcd\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 = [My_Dev_Path]**Test.dll, ConfigFile = , ConnectorFolder = C:\Users[UserName]\AppData\Local\Microsoft\VisualStudio\17.0_ba1beff7\Extensions\vm1rsne4.fcd\Connectors\Generic-net6.0 } Loading [My_Dev_Path]*Test.dll Test, 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[UserName].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. `

gasparnagy commented 1 year ago

Try to run the mentioned command

[My_Dev_Path]> dotnet exec C:\Users[UserName]\AppData\Local\Microsoft\VisualStudio\17.0_ba1beff7\Extensions\vm1rsne4.fcd\Connectors\Generic-net6.0\specflow-vs.dll discovery [My_Dev_Path]\bin***Test.dll ""

from a console. Most probably you will see an error that might help to diagnose the problem.

hatefi-arman commented 1 year ago

Hi @gasparnagy I get exactly same error message I get in VS output panel and I posted above.

gasparnagy commented 1 year ago

@hatefi-arman then the only way to figure out what's wrong is to download this repo and run the generic connector console project with the same argument using the debugger... (This is just a console app, you don't need any VS magic to run it.)

oa-dodo commented 4 months ago

I suddenly started having this navigation problem too. Can't recall the exact moment so can't guess the culprit. Don't get any massege. It just do nothing. I'm trying to navigate to step defined in steps file in the same namespace.

Have Visual Studio 2022 (64-bit) 17.9.7 SpecFlow 2022.1.91.26832