rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.05k stars 575 forks source link

When using assembly binding redirect a connection error is shown #1434

Closed pabermod closed 7 months ago

pabermod commented 7 months ago

Describe the bug

When I use assembly binding redirection for System.Runtime.CompilerServices.Unsafe, if a new version of that library is used through a dependency update, and if it does not match the used version, a BrokerUnreachableException is thrown instantly when trying to connect:

Error connecting to host rabbitmq-ssl. RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.IO.IOException: connection.start was never received, likely due to a network timeout en RabbitMQ.Client.Framing.Impl.Connection.StartAndTune() en RabbitMQ.Client.Framing.Impl.Connection.Open(Boolean insist) en RabbitMQ.Client.Framing.Impl.Connection..ctor(IConnectionFactory factory, Boolean insist, IFrameHandler frameHandler, String clientProvidedName) en RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) --- Fin del seguimiento de la pila de la excepción interna ---

Reproduction steps

Download the attached solution and start the project.

RabbitMQRedirectAssembly.zip

The System.Runtime.CompilerServices.Unsafe dll is 5.0.0.0 version but in the redirect assembly is specified 6.0.0.0.

When connecting to rabbitmq there should be an exception that indicates that the dll was not found. but instead a BrokerUnreachable exception is shown

Expected behavior

When connecting to rabbitmq there should be an exception that indicates that the dll was not found

Additional context

No response

lukebakken commented 7 months ago

I have added your code here and am investigating:

https://github.com/lukebakken/rabbitmq-dotnet-client-1434

lukebakken commented 7 months ago

@pabermod please take a look here. Thanks!

lukebakken commented 7 months ago

Fixed by #1438

lukebakken commented 7 months ago

@pabermod just FYI, 6.8.0 has officially been released. Announcing it soon.