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=22.214.171.124, 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)
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?
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
to the specific version 126.96.36.199. (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 188.8.131.52, by expanding the references of your project and look at the properties of your reference:
The screenshot shows the old version 184.108.40.206, as desired. Of course you can look up the version of the referenced DLL at any time in this way.
User contributions licensed under CC BY-SA 3.0