Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve parameter 'Reqnroll.IReqnrollOutputHelper reqnrollFlowOutputHelper' #357

Open
Antwane opened this issue Dec 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Antwane
Copy link

Antwane commented Dec 16, 2024

Reqnroll Version

2.2.1

Which test runner are you using?

xUnit

Test Runner Version Number

2.8.1

.NET Implementation

.NET 8.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

No response

Issue Description

The dependency IReqnrollOutputHelper is not injected by default when using Autofac plugin. If you try to add it without registering it will result in the above exception. The other DI plugins seem to inject this by default but Autofac doesn't. The workaround is to inject it manually like so:

containerBuilder
    .Register<IReqnrollOutputHelper>(c =>
    {
        var threadContext = c.Resolve<TestThreadContext>();

        var outputHelper = threadContext.TestThreadContainer.Resolve<IReqnrollOutputHelper>();

        return outputHelper;
    });

Steps to Reproduce

Try to use IReqnrollOutputHelper in your project anywhere in your project while using Autofac plugin.

Link to Repro Project

No response

@Antwane Antwane added the bug Something isn't working label Dec 16, 2024
@gasparnagy gasparnagy added enhancement New feature or request and removed bug Something isn't working labels Dec 18, 2024
@gasparnagy
Copy link
Contributor

@Antwane Could you please send a pull request for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants