Mediator icon indicating copy to clipboard operation
Mediator copied to clipboard

Issue on Project with Mediator and MassTransit

Open adamtrip opened this issue 4 months ago • 1 comments

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!

adamtrip avatar Feb 29 '24 14:02 adamtrip