In my particular case we're using the RabbitMQ client package from NuGet and having some issues with it's auto-recovery. I want to add some additional logging within the implementation, so I took the source for the version we're using, added a few lines of log messages and built it. Ideally I'd be able to put the assembly in place on our test machine that's reproducing the issue, put in a temporary binding redirect and call it a day. But as far as I can tell it's ignoring the redirect:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="RabbitMQ.Client" publicKeyToken=null culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
Here's the error message I get when I try to run it:
.\ClientAgent.Service.exe :
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Unhandled Exception:
System.IO.FileLoadException: Could not load file or assembly 'RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at ClientAgent.Service.RabbitMqNLogEventListener..ctor()
at ClientAgent.Service.ClientAgentProgram.Main()
Note that it's still referencing the PublicKeyToken of 89e7d7c5feba84ce.
User contributions licensed under CC BY-SA 3.0