Error after upgrading to R2 2018 - The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
Environment
Product Version | 12.1.18.516 and above |
Product | Progress® Telerik® Reporting |
Error Message
Error registering the viewer with the service. An error has occurred. The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
Description
An error with the above message occurs after an update from a version prior to 12.1.18.516 to version 12.1.18.516 or above. The exception is related to Newtonsoft.Json version that is referred in the project. Starting with Telerik Reporting R2 2018 (12.1.18.516) the assemblies and NuGet packages depending on Newtonsoft.Json require 9.0.1 or newer version of the NuGet package. With prior versions we needed Newtonsoft.Json (4.5.11.15520 or later).
Solution
Update the Newtonsoft.Json NuGet package referred in the project to at least version 9.0.1. If you update to a newer version, include/modify the corresponding bindingRedirect for Newtonsoft.Json in the configuration file of the project (Web.config).
<configuration>
.....
<runtime>
.....
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-X.X.X.X" newVersion="X.X.X.X" />
</dependentAssembly>
.....
</assemblyBinding>
</runtime>
.....
</configuration>
X.X.X.X stands for the actual version of the referred Newtonsoft.Json assembly version (for example 11.0.0.0).
Rebuild the project after the update.