-
Notifications
You must be signed in to change notification settings - Fork 11
The given key 'Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope' was not present in the dictionary. #88
Comments
@VladislavKutsTAQA Thanks for your report. I notice you are using Specflow 3.10.2-beta which introduces async features for the first time. I haven't tested the plugin against this beta version yet. However the exception occurs in a piece of code that was rewritten in the last version, so would you be so kind to try using v3.9.2 of the SpecFlow.DependencyInjection plugin and see if it still happens? |
A can’t downgrade specflow version
***@***.***
Vladyslav Kuts
Test Automation Engineer L2
Mobile: +380663045020 <tel:+380663045020>
LinkedIn<https://www.linkedin.com/in/%D0%B2%D0%BB%D0%B0%D0%B4%D0%B8%D1%81%D0%BB%D0%B0%D0%B2-%D0%BA-43b8a61a4/>
Ushakova, Dnipro, 49061, Ukraine Timezone: (UTC+02:00)
Working Remotely Timezone: (UTC+02:00)
epam.com <http://www.epam.com>
***@***.***
CONFIDENTIALITY CAUTION AND DISCLAIMER
This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.
From: Mark Hoek ***@***.***>
Sent: Tuesday, June 7, 2022 2:26 PM
To: solidtoken/SpecFlow.DependencyInjection ***@***.***>
Cc: Vladyslav Kuts ***@***.***>; Mention ***@***.***>
Subject: Re: [solidtoken/SpecFlow.DependencyInjection] The given key 'Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope' was not present in the dictionary. (Issue #88)
@VladislavKutsTAQA<https://urldefense.com/v3/__https:/github.com/VladislavKutsTAQA__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWV-p_HvMV$> Thanks for your report. I notice you are using Specflow 3.10.2-beta which introduces async features for the first time. I haven't tested the plugin against this beta version yet.
However the exception occurs in a piece of code that was rewritten in the last version, so would you be so kind to try using v3.9.2 of the SpecFlow.DependencyInjection plugin<https://urldefense.com/v3/__https:/github.com/solidtoken/SpecFlow.DependencyInjection/releases/tag/v3.9.2__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWV-elQyy-$> and see if it still happens?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/solidtoken/SpecFlow.DependencyInjection/issues/88*issuecomment-1148538080__;Iw!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWVzp4b2SU$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYY5OX7A6EP3IU5P3LHN2WDVN4WVHANCNFSM5YB5L2RQ__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWVyRpF3jL$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
All good! Thanks!
***@***.***
***@***.***
***@***.***
Vladyslav Kuts
Test Automation Engineer L2
Mobile: +380663045020 <tel:+380663045020>
LinkedIn<https://www.linkedin.com/in/%D0%B2%D0%BB%D0%B0%D0%B4%D0%B8%D1%81%D0%BB%D0%B0%D0%B2-%D0%BA-43b8a61a4/>
Ushakova, Dnipro, 49061, Ukraine Timezone: (UTC+02:00)
Working Remotely Timezone: (UTC+02:00)
epam.com <http://www.epam.com>
***@***.***
CONFIDENTIALITY CAUTION AND DISCLAIMER
This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.
From: Mark Hoek ***@***.***>
Sent: Tuesday, June 7, 2022 2:26 PM
To: solidtoken/SpecFlow.DependencyInjection ***@***.***>
Cc: Vladyslav Kuts ***@***.***>; Mention ***@***.***>
Subject: Re: [solidtoken/SpecFlow.DependencyInjection] The given key 'Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope' was not present in the dictionary. (Issue #88)
@VladislavKutsTAQA<https://urldefense.com/v3/__https:/github.com/VladislavKutsTAQA__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWV-p_HvMV$> Thanks for your report. I notice you are using Specflow 3.10.2-beta which introduces async features for the first time. I haven't tested the plugin against this beta version yet.
However the exception occurs in a piece of code that was rewritten in the last version, so would you be so kind to try using v3.9.2 of the SpecFlow.DependencyInjection plugin<https://urldefense.com/v3/__https:/github.com/solidtoken/SpecFlow.DependencyInjection/releases/tag/v3.9.2__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWV-elQyy-$> and see if it still happens?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/solidtoken/SpecFlow.DependencyInjection/issues/88*issuecomment-1148538080__;Iw!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWVzp4b2SU$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AYY5OX7A6EP3IU5P3LHN2WDVN4WVHANCNFSM5YB5L2RQ__;!!GF_29dbcQIUBPA!xmjxks_vpX5euhLZYKlCXrAyehjIbNtm41FzxnqyPPem7dIVDJYb7xjbLK2tyI7KEZ1FChfbNZm79lSuPAiWVyRpF3jL$>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
You don't need to downgrade SpecFlow (I see your tests are |
I had the same issue and downgrading to version 3.9.2 of |
This worked for me. Thanks |
Thanks for letting me know. I'll review the code and see if I can update it for the major version (v4). |
Closing this issue because the plugin will be donated to Reqnroll. |
C#, .net core 5.0. Specflow 3.10.2, SolidToken.SpecFlow.DependencyInjection 3.9.3
All hooks are running, after i get this issue.
I've added and implemented this nuget like this:
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using POS.BusinessLogic.Database.Employee;
using POS.BusinessLogic.DetailContainer;
using POS.BusinessLogic.Requests.Payment;
using POS.BusinessLogic.Requests.Pops;
using POS.BusinessLogic.Requests.Stall;
using POS.BusinessLogic.Services.PaymentEmulator;
using POS.BusinessLogic.Services.PopsEmulator;
using POS.BusinessLogic.Services.StallEmulator;
using POS.Core.Environment;
using POS.Core.Nats;
using POS.Core.StallStorage;
using Serilog;
using Serilog.Core;
using SolidToken.SpecFlow.DependencyInjection;
namespace POS.Steps.Hooks
{
public static class CreateServicesHooks
{
[ScenarioDependencies]
public static IServiceCollection CreateServices()
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
}
StackTrace:
System.Collections.Generic.KeyNotFoundException : The given key 'Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary
2.ThrowKeyNotFoundException(TKey key) at System.Collections.Concurrent.ConcurrentDictionary
2.get_Item(TKey key)at SolidToken.SpecFlow.DependencyInjection.DependencyInjectionPlugin.<>c.b__9_22(IServiceProvider sp)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at SolidToken.SpecFlow.DependencyInjection.DependencyInjectionTestObjectResolver.ResolveBindingInstance(Type bindingType, IObjectContainer container)
at TechTalk.SpecFlow.ScenarioContext.GetBindingInstance(Type bindingType)
at lambda_method37(Closure , IContextManager , String , EmployeeInfo )
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBindingAsync(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, DurationHolder durationHolder)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatchAsync(BindingMatch match, Object[] arguments, DurationHolder durationHolder)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepAsync(IContextManager contextManager, StepInstance stepInstance)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStepAsync()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrorsAsync()
at POS.FeatureFiles.InStore.Basket.Item.ItemDisplayFeature.ScenarioCleanupAsync()
at POS.FeatureFiles.InStore.Basket.Item.ItemDisplayFeature.ClientCanSeeSplitLabelIfOrderWasSplitted() in C:\pops-automation\POS.FeatureFiles\InStore\Basket\Item\ItemDisplay.feature:line 55
at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter
1.GetResult() at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func
1 invoke)at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.b__0()
at NUnit.Framework.Internal.Commands.DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
The text was updated successfully, but these errors were encountered: