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

Issue on Project with Mediator and MassTransit #139

Open
adamtrip opened this issue Feb 29, 2024 · 1 comment
Open

Issue on Project with Mediator and MassTransit #139

adamtrip opened this issue Feb 29, 2024 · 1 comment

Comments

@adamtrip
Copy link

adamtrip commented Feb 29, 2024

When using Mediator on the same project with MassTransit I get the following error:

System.Exception: 'Invalid configuration detected for Mediator. Generated code for 'Singleton' lifetime, but got 'Scoped' lifetime from options. This means that the source generator hasn't seen the 'AddMediator' method call during compilation. Make sure that the 'AddMediator' method is called from the project that references the Mediator.SourceGenerator package.'

image

If I remove the MassTransit package and service registrations it all works just fine.

It only occurs in mediator 3.0.0-preview.X. If I downgrade to version 2.0.* the error does not happen.

EDIT: On version 2.1.6 also gives the same error

Thanks in advance!

@MustafaaYildirimmm
Copy link

Hello, I solved this;

I loaded Mediator.SourceGenerator and Mediator.Abstractions libraries into the API project and also the Mediator.Abstractions library into the project where commands and queries are located.

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

No branches or pull requests

2 participants