Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 933
hellouworld Avatar asked Dec 10 '25 15:12

hellouworld


1 Answers

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.

like image 93
Hermann.Gruber Avatar answered Dec 13 '25 05:12

Hermann.Gruber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!