The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'

4 posts, 0 answers
  1. Marcel
    Marcel avatar
    6 posts
    Member since:
    Oct 2016

    Posted 04 Jul 2018 Link to this post

    Hello, I'm trying to update the version of Telerik reports in my app by following the documentation steps:

    https://docs.telerik.com/reporting/installation-upgrading-newer-version#old-projects-manual-upgrade .

    .. however, after generating the .trdx file, when I try to render the file in html it shows the error:

        "The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'."

    I have not found a solution to this in the documentation yet, could you help me?

     

     


  2. Todor
    Admin
    Todor avatar
    384 posts

    Posted 09 Jul 2018 Link to this post

    Hi Marcel,

    The error may be related to the version of Newtonsoft.Json referred in the project.
    Note that starting with Telerik Reporting R2 2018 (12.1.18.516), the required version of Newtonsoft.Json is 9.0.1 or later, as compared to 4.5.11.15520 or later before.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Nathan
    Nathan avatar
    6 posts
    Member since:
    Jan 2013

    Posted 12 Jul 2018 Link to this post

    We are having the same issue since the upgrade.  Our report server is erroring out with the message below:

    {"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Entry point was not found.","ExceptionType":"System.EntryPointNotFoundException","StackTrace":" at Newtonsoft.Json.Serialization.IContractResolver.ResolveContract(Type type)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe(Object value)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at System.Web.Http.WebHost.HttpControllerHandler.d__22.MoveNext()"}}

  4. Todor
    Admin
    Todor avatar
    384 posts

    Posted 17 Jul 2018 Link to this post

    Hello Nathan,

    The issue should be resolved after updating the Newtonsoft.Json NuGet package to version 9.0.1.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top