TL;DR: Add reference to Newtonsoft.Json.dll in every project
If you’re getting a runtime exception:
System.IO.FileLoadException: Could not load file or assembly ‘Newtonsoft.Json, Version=220.127.116.11, 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).
In our particular case, we had to make sure that every project that directly and (what is more likely) indirectly depends on this assembly, has a reference to the version you’re using, has the nuget package installed.
Checking you have correct assembly redirects in-place won’t hurt as well:
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-18.104.22.168" newVersion="22.214.171.124" /> </dependentAssembly> </runtime> </configuration>