4

A cache is initialized from another using the regular Dictionary constructor. for the first time, I get a

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

private Dictionary<uint, Dictionary<ClassA, ClassB>> cache;
private void updateCache(Dictionary<uint, Dictionary<ClassA, ClassB>> otherCache) 
{
  cache = new Dictionary<uint, Dictionary<ClassA, ClassB>>(otherCache); // Raises the exception
}

I verified that cache and othercache really have the same type.

How is this even possible ?!

keenthinker
  • 7,645
  • 2
  • 35
  • 45
Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101

0 Answers0