Newtonsoft.JSON Nuget Package Updates

posted Nov 26, 2018, 2:30 PM by Eric Patrick
The qbo.Core.sln is being updated to include references to Newtonsoft.Json version 11+.  This mandates an updated to web.config:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
    ...
    </assemblyBinding>
</runtime>

If you miss this update, you will received an error message along these lines:

FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'; or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Developers should check any plugin-based solutions to ensure the current version of Newtonsoft.Json is referenced (currently v11.0.2). If you fail to update a plugin solution, and deploy it after deploying core, you will deploy an older version of Newtonsoft.Json (e.g. v10), causing the reverse of the above error. 
Comments