You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticboolwasExecuted=false;[BeforeScenario]publicstaticvoidConfigureServices(ITestRunContexttestRunContext,ITestThreadContexttestThreadContext){if(wasExecuted)return;wasExecuted=true;varglobalContainer=testRunContext.TestRunContainer;// this is the real global container used by all parallel threadsvartestThreadContainer=testThreadContext.TestThreadContainer;// this is what you have used in your hook//do service regs}
I get error like: System.InvalidOperationException : No service for type 'Reqnroll.ITestThreadContext' has been registered.
When using BeforeFeature or BeforeScenario, the CreateServices is called first, after that the Before method is called, so that does not work.
If I use BeforeTestRun, I get error:
System.Collections.Generic.KeyNotFoundException : The given key 'Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope' was not present in the dictionary.
Reqnroll Version
2.1.1
Which test runner are you using?
xUnit
Test Runner Version Number
xunit.runner.visualstudio 2.8.2
.NET Implementation
.NET 8.0
Test Execution Method
Visual Studio Test Explorer
Content of reqnroll.json configuration file
No response
Issue Description
I want to access the IReqnrollOutputHelper in the [ScenarioDependencies] method in order to register my custom ILogger implementation.
Steps to Reproduce
I followed this #247
When I try this code:
I get error like:
System.InvalidOperationException : No service for type 'Reqnroll.ITestThreadContext' has been registered.
When I use this code:
When using
BeforeFeature
orBeforeScenario
, the CreateServices is called first, after that the Before method is called, so that does not work.If I use
BeforeTestRun
, I get error:The only code which does work is like:
Although I'm not sure this is the correct solution....
Link to Repro Project
StefH/Stef.Extensions.SpecFlow.Logging#1
The text was updated successfully, but these errors were encountered: