Sitelet https://github.com/microsoft/ApplicationInsights-dotnet/issues/1622
Skip to content

"An item with the same key has already been added." when the same request is submitted more than once. #1622

Description

Using Polly for retry policy inside a DelegateHandler (in essence, re-running SendAsync with the same request a certain number of time), I started to have this exception popping up in Visual Studio.

Turns out that when debugging a netcoreapp2.0 project in VS, ApplicationInsights is automatically injected (see dotnet/aspnetcore#2051).

This exception is raised here: https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/DependencyCollector/Shared/Implementation/HttpCoreDiagnosticSourceListener.cs#L383 since the same request has been already sent in the same channel. There should be a check to update the content instead of a blind Add.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions