Hi everyone,
I’m currently learning MassTransit by following a great video series by Chris Patterson: https://www.youtube.com/watch?v=dxHNAn69x6w&list=PLx8uyNNs1ri2MBx6BjPum5j9_MMdIfM9C&index=1. Unfortunately, when trying to add mediator as instructed in the first video I hit the following error:
‘IServiceCollectionBusConfigurator’ does not contain a definition for ‘AddMediator’ and the best extension method overload ‘DependencyInjectionRegistrationExtensions.AddMediator(IServiceCollection, Action)’ requires a receiver of type ‘IServiceCollection’
After a bit of Googling I came across some upgrade documentation with the following highlight:
Container configuration has changed, and now uses the AddMediator method (instead of AddMassTransit).
The solution ended up being as follows:
services.AddMediator(x =>
{
x.AddConsumersFromNamespaceContaining();
x.AddRequestClient();
});
{
x.AddConsumersFromNamespaceContaining();
x.AddRequestClient();
});
Thanks to this link for the info: https://masstransit-project.com/getting-started/upgrade-v6.html#version-7
Leave a Reply