Skip to content

Unable to access test execution dependent service 'Reqnroll.TestThreadContext' with the Reqnroll.Microsoft.Extensions.DependencyInjection plugin #562

Discussion options

You must be logged in to vote

For the TestContext you could use parameter injection:

[BeforeTestRun]
public static void BeforeTestRun (TestContext testContext) 
{
    if (testContext.Properties.Contains ("Environment") && 
        testContext.Properties["Environment"].ToString () == "dev") 
    {
        threadContext.Add ("portal", configuration["portal:url"]);
    }
}

see https://docs.reqnroll.net/latest/integrations/mstest.html#accessing-testcontext

for the TestThreadContext if have to search

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joey7755
Comment options

Answer selected by Code-Grump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #561 on April 08, 2025 22:43.