Reputation: 63
I went back to my automated testing using Specflow and visual studio and encountered a warning of:
The project bindings (e.g. step definitions) could not be discovered. Navigation, step completion and other features are disabled.
And so, when i double click it this is the detail message:
Message:
You must install or update .NET to run this application.
App: c:\users\budongdrummond\appdata\local\microsoft\visualstudio\17.0_5480b73d\extensions\imt2pkmz.jeg\Connectors\Generic-net7.0\specflow-vs.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
.NET location: C:\Program Files\dotnet\
The following frameworks were found:
8.0.12 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
9.0.1 at
[C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
And so yes, i can see i don't have .NET 7 runtime installed (not sure why this suddenly an issue when it was all working fine during Xmas period in 2024), but i do however, have .NET 8 installed and when i set my projects to target the framework .NET 8 from its properties it will throw the same issue above.
I gave up and proceed to downloaded the .NET 7 runtime and rebuild my projects (whilst .NET 8 still being targeted as 'Target Framework') and I still have the same warning message as above but when double clicking it a different output message appears:
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)
...
...
...
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.
Again I gave up, and changed my projects to use .NET 7 as the target framework and rebuild, and it somehow has fixed the issue - I can see the my Scenario can be linked to its Definition [Bindings] as it should be.
The question is, why I cannot set .NET 8 as my targeted framework and be working as normal?!
How to point to the desire framework without its gone freaking out? could any expert in Specflow setup help me in this situation?
I seen a link in Google search asking the same question but the article no longer available.
Update: although i sorted the scenario not linking to its Definitons - now i cannot run the test - it can build and started, but not executing it! :/ upon clicking the 1 error in the test explorer; it still mentioned the same issue as seen above
Upvotes: 0
Views: 191