SpecFlow.VS icon indicating copy to clipboard operation
SpecFlow.VS copied to clipboard

The type initializer for 'AutoTests.Framework.Logging.Log' threw an exception.

Open sam22blr opened this issue 4 years ago • 0 comments

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

SpecFlow Section in app.config or content of specflow.json

<runtime stopAtFirstError="true" missingOrPendingStepsOutcome="Error" />
</specFlow>
<add key="FunctionsType" value="AutoTests.ProjectSpecificCommons.Transformations.Tokens.Functions, AutoTests.ProjectSpecificCommons" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
  <dependentAssembly>
    <assemblyIdentity name="TechTalk.SpecFlow.Generator" publicKeyToken="0778194805d6db41" culture="neutral" />
    <bindingRedirect oldVersion="2.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="TechTalk.SpecFlow.Parser" publicKeyToken="0778194805d6db41" culture="neutral" />
    <bindingRedirect oldVersion="2.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="TechTalk.SpecFlow.Utils" publicKeyToken="0778194805d6db41" culture="neutral" />
    <bindingRedirect oldVersion="2.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.2.15.0" newVersion="1.2.15.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="nunit.framework" publicKeyToken="2638cd05610744eb" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.13.1.0" newVersion="3.13.1.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
  </dependentAssembly>
</assemblyBinding>

Issue Description

Info: OnActivityStarted: Starting Visual Studio Extension... Info: CreateProjectScope: Initializing project: AutoTests.Specs Info: OnSettingsInitialized: Project settings initialized: .NETFramework,Version=v4.8,SpecFlow:3.9.74 Warning: AndDiscoveryProviderSucceed: Error during binding discovery. Command executed: C:\TestAutomation\Automation5.1\AutoTests.Specs\bin\Debug> C:\Program Files\dotnet\dotnet.exe exec C:\Users<user>\AppData\Local\Microsoft\VisualStudio\17.0_53419117\Extensions\wh4q3a5i.sy3\Connectors\Generic-net6.0\specflow-vs.dll discovery C:\TestAutomation\Automation5.1\AutoTests.Specs\bin\Debug\AutoTests.Specs.dll C:\TestAutomation\Automation5.1\AutoTests.Specs\App.config Exit code: 0 Message: Info Found V3.9.74.14555 at C:\TestAutomation\Automation5.1\AutoTests.Specs\bin\Debug\TechTalk.SpecFlow.dll Info Chosen BindingRegistryFactoryBeforeV310000 for 309074 Error System.TypeInitializationException: The type initializer for 'AutoTests.Framework.Logging.Log' threw an exception. ---> System.MissingMethodException: Method not found: 'System.String System.AppDomainSetup.get_ConfigurationFile()'. at NLog.Internal.Fakeables.AppDomainWrapper..ctor(AppDomain appDomain) at NLog.Internal.Fakeables.AppDomainWrapper.get_CurrentDomain() at NLog.LogFactory.get_CurrentAppDomain() at NLog.LogFactory.d__a.MoveNext() at NLog.LogFactory.get_Configuration() at NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey) at NLog.LogFactory.GetLogger(String name) at NLog.LogManager.GetLogger(String name) at AutoTests.Framework.Logging.Log..cctor() in C:\TestAutomation\Automation5.1\AutoTests.Framework\Logging\Log.cs:line 7 --- End of inner exception stack trace --- at AutoTests.ProjectSpecificCommons.HelpersAndUtils.CommonMethods.LogExecutionStatus(String pointName) in C:\TestAutomation\Automation5.1\AutoTests.ProjectSpecificCommons\HelpersAndUtils\CommonMethods.cs:line 997 at AutoTests.Bootstraper.SpecflowPlugin.Bootstraper.Initialize(RuntimePluginEvents runtimePluginEvents, RuntimePluginParameters runtimePluginParameters, UnitTestProviderConfiguration unitTestProviderConfiguration) in C:\TestAutomation\Automation5.1\AutoTests.Bootstraper.SpecflowPlugin\Bootstraper.cs:line 56 at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.LoadPlugin(String pluginPath, IRuntimePluginLoader pluginLoader, RuntimePluginEvents runtimePluginEvents, UnitTestProviderConfiguration unitTestProviderConfigration, ITraceListener traceListener, Boolean traceMissingPluginAttribute) in D:\a\1\s\TechTalk.SpecFlow\Infrastructure\ContainerBuilder.cs:line 170 at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.LoadPlugins(IRuntimeConfigurationProvider configurationProvider, ObjectContainer container, RuntimePluginEvents runtimePluginEvents, SpecFlowConfiguration specFlowConfiguration, UnitTestProviderConfiguration unitTestProviderConfigration, Assembly testAssembly) in D:\a\1\s\TechTalk.SpecFlow\Infrastructure\ContainerBuilder.cs:line 152 at TechTalk.SpecFlow.Infrastructure.ContainerBuilder.CreateGlobalContainer(Assembly testAssembly, IRuntimeConfigurationProvider configurationProvider) in D:\a\1\s\TechTalk.SpecFlow\Infrastructure\ContainerBuilder.cs:line 59 at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateObjectContainer(Assembly testAssembly, ContainerBuilder containerBuilder, IRuntimeConfigurationProvider configurationProvider, IDefaultDependencyProvider dependencyProvider) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 41 at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactoryVLatest.CreateObjectContainer(Assembly testAssembly, Object containerBuilder, IRuntimeConfigurationProvider configurationProvider, Object dependencyProvider) in D:\a\1\s\Connectors\SpecFlow.VisualStudio.SpecFlowConnector.Generic\SpecFlowProxies\BindingRegistryFactoryVLatest.cs:line 36 at SpecFlowConnector.SpecFlowProxies.BindingRegistryFactory.<>c__DisplayClass2_0.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, Func2 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, Option1 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, Option1 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, Func2 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.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, Func2 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](Func1 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.

Steps to Reproduce

The issue occurs while building using VS 2022.

Link to Repository Project

No response

sam22blr avatar Oct 06 '22 21:10 sam22blr