HeaderCollection Key Already Added: Cache-Control

3 posts, 0 answers
  1. Ben
    Ben avatar
    2 posts
    Member since:
    Jan 2020

    Posted 03 Mar Link to this post

    I'm trying to set things up for the first time in a .Net Core ASP 3.1 Application.

    My ReportsController appears to be recognized properly (the constructor is called with the IReportServiceConfiguration) and the client attempts to call:

     

    api/reports/resources/js/telerikReportViewer (with a ?_=<number> on the end)

     

    But i'm getting this error:

    "Message": "An error has occurred.","ExceptionMessage": "An item with the same key has already been added. Key: Cache-Control"

     

    Full:

    {

    "Message": "An error has occurred.","ExceptionMessage": "An item with the same key has already been added. Key: Cache-Control","ExceptionType": "System.ArgumentException","StackTrace": " at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\r\n at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\r\n at Microsoft.AspNetCore.HttpSys.Internal.HeaderCollection.Add(String key, StringValues value)\r\n at Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.GetResourceCore(String folder, String resourceName, Type type)\r\n at Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.GetResource(String folder, String resourceName)\r\n at lambda_method(Closure , Object , Object[] )\r\n at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"

    }

  2. Ben
    Ben avatar
    2 posts
    Member since:
    Jan 2020

    Posted 03 Mar in reply to Ben Link to this post

    Note that calling "/api/reports/formats" does succeed.
  3. Ivan Hristov
    Admin
    Ivan Hristov avatar
    220 posts

    Posted 06 Mar Link to this post

    Hello Ben,

    I provided an answer in the support ticket #1456298. Since the cause of the issue is not yet determined, I will not paste here my answer. As soon as we are sure what the problem is, I will update the current forum thread so it will be useful for all the developers that might hit the same problem.

    Regards,
    Ivan Hristov
    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