Microsoft.Diagnostics.Tracing.EventSource with the RabbitMQ.Client.dll exception

2

Why may I be getting the following error and how could I fix it?

An unhandled exception of type 'System.IO.FileLoadException' occurred in RabbitMQ.Client.dll Could not load file or assembly 'Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

UPDATE

After the comment in the comments sections below I am trying to find the Microsoft.Diagnostics.Tracing.EventSource in Visual Studio 2019. I am using the shortcut Ctrl + Shift + T for this, but still can not find the file. Where could the file be placed?

enter image description here

.net
rabbitmq
nuget
runtime-error
assembly-loading
asked on Stack Overflow Nov 19, 2019 by hellouworld • edited Feb 3, 2020 by Hermann.Gruber

1 Answer

2

You're not alone - this is a known issue with the RabbitMQ .NET client, which has also been discussed on the rabbitmq-users mailing list.

The fix will ship with the next major release (v6) of the client. Until then, a workaround for may be to downgrade the nuget package

Microsoft.Diagnostics.Tracing.EventSource.Redist

to the specific version 1.1.28.0. (This was suggested in the discussion of the issue.) How to downgrade is explained here - observe that in the second step, you need to choose the specific version mentioned above, instead of the latest version.

My team has recently hit the same issue, and we're testing this workaround at the moment.

UPDATE (2020-02-03): We've successfully tested the workaround; the app no longer crashes.

And I may add a short explanation of Nair's comment. After installing the suitable old version of the nuget package, you can verify in the Solution Explorer that you really have version 1.1.28.0, by expanding the references of your project and look at the properties of your reference:

The Properties Window for Microsoft.Diagnostics.Tracing.EventSource.Redist DLL in the Solution Explorer

The screenshot shows the old version 1.1.28.0, as desired. Of course you can look up the version of the referenced DLL at any time in this way.

UPDATE (2020/07/13): version 6 of the rabbitmq .NET client has been released. In our team, we still cannot update because we need to wait for the correspondig version 6 of the NServiceBus wrapper, but that will be released as well within the next few weeks.

answered on Stack Overflow Jan 30, 2020 by Hermann.Gruber • edited Jul 13, 2020 by Hermann.Gruber

User contributions licensed under CC BY-SA 3.0