Open bastarnae opened 2 years ago
Same here.
@gasparnagy could this be a problem with the new connector?
@bastarnae @Vic152 A few questions:
stepAssemblies
config)?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.
@Vic152 Could you please zip your project as-is (with the compiled assemblies as well in bin/debug folder) and attach to this ticket?
will attach zip now
calculator.zip for some reason it needs to be new comment...
@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.
@Vic152 For me this works fine. In the error list, you have a message that might be related:
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
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.<
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
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.<
@Vic152 That's strange... What is your exact Visual Studio version (displayed by the Help / About dialog)?
@Vic152 That's strange... What is your exact Visual Studio version (displayed by the Help / About dialog)?
for reasons I also have these installations
@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.
I will try that, but first I will see if this happens with another user on another laptop ;)
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
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
For calculator project I do not get numbers highlighted
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
I tried:
no joy
@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 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.
To add to the list I repaired the VS22 installation in case it was corrupted.
I started digging, this is the line that throw always when I load the solution
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.
Sorry for the late reply.
Here are my findings based on the steps provided:
Yes
They are provided as project reference and the dll is generated on build.
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
Yes, the compilation is in "Debug" mode.
Yes, the assemblies have a .pdb file created.
@gasparnagy is the information provided sufficient?
@gasparnagy ; @SabotageAndi
Hello, do you have any update regarding this issue? Thank you!
@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!
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.
It was due to AOP library that we used, after modifying to invoke after method, its working
@saiparth Thx for the update.
@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
Hi, I am using VS 2022 Professional - Version 17.5.3 (recently installed) and installed SpecFlow extension 2022.1.91.26832
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.JsonConverter
1.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](ReadOnlySpan
1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 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.
`
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.
Hi @gasparnagy I get exactly same error message I get in VS output panel and I posted above.
@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.)
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
Used Visual Studio
Visual Studio 2022
Are the latest Visual Studio updates installed?
Yes
SpecFlow Section in app.config or content of specflow.json
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.
Steps to Reproduce
.NET Framework 4.7.2 Nugets Nunit + Specflow up to date
Link to Repository Project
No response