© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
7 replies
M B V R K

❔ Reference to type 'IReceiveEndpointConfigurator' claims it is defined in 'MassTransit'

Hello friends,
I have a Microservice which using the
MassTransit
MassTransit
as an Abstraction over
RabbitMQ
RabbitMQ
, I created a separated class the constains an extension method to register and configure the MassTransit settings:

public static class RabbitMQRegistrar
{
    public static void ConfigureRabbitMQ(this IServiceCollection services, IConfiguration configuration)
    {
        var rabbitMqOptions = configuration.GetSection("RabbitMQ:Settings").Get<RabbitMqOptions>();
        var authServiceRabbitMqEndPointsOptions = configuration.GetSection("RabbitMQ:EndPoints:AuthService").Get<AuthServiceRabbitMqEndpointsOptions>();
        var authServiceRabbitMqEndPoints = authServiceRabbitMqEndPointsOptions;


        services.AddMassTransit(busConfigurator => busConfigurator.AddBus(provider => Bus.Factory.CreateUsingRabbitMq(cfg =>
        {
            cfg.Host(rabbitMqOptions.HostName, hostConfig =>
            {
                hostConfig.Username(rabbitMqOptions.UserName);
                hostConfig.Password(rabbitMqOptions.Password);
            });

            cfg.ReceiveEndpoint(authServiceRabbitMqEndPoints.UserCreatedEventQueue, ep => ep.Consumer<AuthServiceUserCreatedMessageConsumer>(provider));

        })));

        services.ConfigureRabbitMQBaseOptions(configuration);
    }
}
public static class RabbitMQRegistrar
{
    public static void ConfigureRabbitMQ(this IServiceCollection services, IConfiguration configuration)
    {
        var rabbitMqOptions = configuration.GetSection("RabbitMQ:Settings").Get<RabbitMqOptions>();
        var authServiceRabbitMqEndPointsOptions = configuration.GetSection("RabbitMQ:EndPoints:AuthService").Get<AuthServiceRabbitMqEndpointsOptions>();
        var authServiceRabbitMqEndPoints = authServiceRabbitMqEndPointsOptions;


        services.AddMassTransit(busConfigurator => busConfigurator.AddBus(provider => Bus.Factory.CreateUsingRabbitMq(cfg =>
        {
            cfg.Host(rabbitMqOptions.HostName, hostConfig =>
            {
                hostConfig.Username(rabbitMqOptions.UserName);
                hostConfig.Password(rabbitMqOptions.Password);
            });

            cfg.ReceiveEndpoint(authServiceRabbitMqEndPoints.UserCreatedEventQueue, ep => ep.Consumer<AuthServiceUserCreatedMessageConsumer>(provider));

        })));

        services.ConfigureRabbitMQBaseOptions(configuration);
    }
}


The issue :
The issue is I get a compile time error in this line :
cfg.ReceiveEndpoint(authServiceRabbitMqEndPoints.UserCreatedEventQueue, ep => ep.Consumer<AuthServiceUserCreatedMessageConsumer>(provider));
cfg.ReceiveEndpoint(authServiceRabbitMqEndPoints.UserCreatedEventQueue, ep => ep.Consumer<AuthServiceUserCreatedMessageConsumer>(provider));

That error says :
Reference to type 'IReceiveEndpointConfigurator' claims it is defined in 'MassTransit', but it could not be found

And I'm sure that this microservice/project has the
MassTransit
MassTransit
installed.

Please any help ? <3
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

CS00012 The type is defined in an assembly that is not referenced. But that assembly it is reference
C#CC# / help
3y ago
Npgsql.NpgsqlOperationInProgressException: A Command is Already in Progress in MassTransit
C#CC# / help
2y ago
❔ Hello, MassTransit Problem
C#CC# / help
3y ago
aaaa java0000, type is defined multiple times
C#CC# / help
3y ago