Fix: The located assembly's manifest definition does not match the assembly reference

Got the below error message ever?

The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I know how frustrating that is.

One of my team member added JSON.NET via nuget and all of a sudden all other devs start getting the above error message while invoking any methods from JSON.NET. I tried a dozen workaround that I got while searching for solution but none of them worked. After careful, time consuming analysis I figured out the issue. Our project was referring few PCL projects which was provided by client. All those projects were referring JSON.NET v6.0.3. Yay! That’s an old stable working client library. I uninstalled JSON.NET v9 and installed v6.0.3 which fixed the issue.

However, what still surprises me is why the dev who added v9 library not getting any error while others devs are getting the error? Weird.

Thanks.

Add comment

Loading