Skip to content

System.ArgumentException: An item with the same key has already been added. #28

Description

@ficnar

This error occasionally occurs after launching a web application. The reason is probably due to the concurrent processing of two HTTP requests, each calling enqueue.

System.ArgumentException: An item with the same key has already been added. Key: default
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Hangfire.Azure.ServiceBusQueue.ServiceBusManager.CreateQueueClients()
   at Hangfire.Azure.ServiceBusQueue.ServiceBusManager.GetSenderAsync(String queue)
   at Hangfire.Azure.ServiceBusQueue.ServiceBusQueueJobQueue.DoEnqueueAsync(List`1 jobs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions