deveroom-visualstudio icon indicating copy to clipboard operation
deveroom-visualstudio copied to clipboard

InvokeDiscovery: Error during binding discovery

Open oryz opened this issue 4 years ago • 5 comments

Hi,

After some extensive re-work of our solution recently (including upgrading from .Net Core 3.1 to 5), deveroom fails during binding discovery:

Info: OnActivityStarted: Starting Deveroom...
Info: CreateProjectScope: Initializing project: TransformationCRMHBF
Info: OnSettingsInitialized: Project settings initialized: .NETCoreApp,Version=v3.1,SpecFlow:3.9.8
Info: InvokeDiscovery: 565 step definitions discovered for project TransformationCRMHBF
Info: InvokeDiscovery: 565 step definitions discovered for project TransformationCRMHBF
Info: CheckProjectSettings: Project settings updated: .NETCoreApp,Version=v5.0,SpecFlow:3.9.52
Info: GetSkippedBindingRegistryResult: Test assembly not found. Please build the project to enable Deveroom features.
Warning: InvokeDiscovery: Error during binding discovery. 
Command executed:
  C:\source\staffconsoletestautomation\GUI\TransformationCRMHBF\bin\Debug\netcoreapp5> C:\Program Files\dotnet\dotnet.exe exec C:\USERS\USERNAME\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\16.0_1C82DC5B\EXTENSIONS\3Z4OGEUI.14U\Connectors\V3-net5.0\specflow-vs.dll discovery C:\source\staffconsoletestautomation\GUI\TransformationCRMHBF\bin\Debug\netcoreapp5\TransformationCRMHBF.dll ""
Exit code: 4
Message: 
Error: Exception has been thrown by the target of an invocation. -> Could not load file or assembly 'Microsoft.Extensions.Configuration.UserSecrets, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
Exception: System.Reflection.TargetInvocationException->System.IO.FileNotFoundException
StackTrace:
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType)
   at TechTalk.SpecFlow.Plugins.RuntimePluginLoader_Patch.LoadPlugin(String pluginAssemblyName, ITraceListener traceListener) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\RuntimePluginLoader.cs:line 28
   at TechTalk.SpecFlow.Plugins.RuntimePluginLoader_Patch.LoadPlugin(String pluginAssemblyName, ITraceListener traceListener, Boolean traceMissingPluginAttribute) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\RuntimePluginLoader.cs:line 12
   at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.LoadPlugin(String pluginPath, IRuntimePluginLoader pluginLoader, RuntimePluginEvents runtimePluginEvents, UnitTestProviderConfiguration unitTestProviderConfigration, ITraceListener traceListener, Boolean traceMissingPluginAttribute)
   at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.LoadPlugins(IRuntimeConfigurationProvider configurationProvider, ObjectContainer container, RuntimePluginEvents runtimePluginEvents, SpecFlowConfiguration specFlowConfiguration, UnitTestProviderConfiguration unitTestProviderConfigration, Assembly testAssembly)
   at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.CreateGlobalContainer(Assembly testAssembly, IRuntimeConfigurationProvider configurationProvider)
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.SpecFlowV3BaseDiscoverer.CreateGlobalContainer(IConfigurationLoader configurationLoader, Assembly testAssembly) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\Discovery\SpecFlowV3BaseDiscoverer.cs:line 36
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.SpecFlowV3BaseDiscoverer.GetBindingRegistry(Assembly testAssembly, String configFilePath) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\Discovery\SpecFlowV3BaseDiscoverer.cs:line 25
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.BaseDiscoverer.DiscoverInternal(Assembly testAssembly, String testAssemblyPath, String configFilePath) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\Discovery\BaseDiscoverer.cs:line 31
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.BaseDiscoverer.Discover(Assembly testAssembly, String testAssemblyPath, String configFilePath) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\Discovery\BaseDiscoverer.cs:line 21
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.VersionSelectorDiscoverer.Discover(Assembly testAssembly, String testAssemblyPath, String configFilePath) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\Discovery\VersionSelectorDiscoverer.cs:line 26
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] 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 SpecFlow.VisualStudio.SpecFlowConnector.ReflectionExtensions.ReflectionCallMethod[T](Object obj, String methodName, Type[] parameterTypes, Object[] args) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ReflectionExtensions.cs:line 31
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.ReflectionSpecFlowDiscoverer.Discover(Assembly testAssembly, String testAssemblyPath, String configFilePath) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V3\Discovery\ReflectionSpecFlowDiscoverer.cs:line 21
   at SpecFlow.VisualStudio.SpecFlowConnector.Discovery.DiscoveryProcessor.Process() in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.V2\Discovery\DiscoveryProcessor.cs:line 26
   at SpecFlow.VisualStudio.SpecFlowConnector.DiscoveryCommand.Execute(String[] commandArgs) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\DiscoveryCommand.cs:line 17
   at SpecFlow.VisualStudio.SpecFlowConnector.ConsoleRunner.EntryPoint(String[] args) in W:\Deveroom\SpecFlow.VS\Connectors\SpecFlow.VisualStudio.SpecFlowConnector\ConsoleRunner.cs:line 23

Warning: InvokeDiscovery: 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/specsolutions/deveroom-visualstudio/issues if you cannot fix.
`

oryz avatar Mar 28 '22 10:03 oryz

The development of the "connectors" (the component that load step definitions from your project) has been moved to the https://github.com/SpecFlowOSS/SpecFlow.VS project. Do you have a chance to try with Visual Studio 2022 and the "SpecFlow for Visual Studio 2022" extension if it works there? If yes, I can port back the more advanced connectors from there to Deveroom.

gasparnagy avatar Mar 29 '22 06:03 gasparnagy

Sure yes I can give that a go - thanks!

oryz avatar Mar 30 '22 01:03 oryz

Hi @gasparnagy ,

I have confirmed that the step definitions are loaded without an issue with Visual Studio 2022 and the Specflow plugin.

Side question - is there going to be deveroom for VS2022?

oryz avatar Apr 13 '22 13:04 oryz

@oryz Thx for the feedback. That's a good news. I try to find time to update Deveroom accordinly, but I can only do it after the Easter week.

There will be no separate Deveroom for VS2022. We decided the two extension to be merged for VS2022 and the "SpecFlow for Visual Studio 2022" extension is now based on the Deveroom codebase.

gasparnagy avatar Apr 13 '22 13:04 gasparnagy

Great, that's good to know! Let me know if you need me to test anything.

oryz avatar May 06 '22 02:05 oryz