An item with the same key has already been added.

hyperdatahyperdata Posts: 2
Getting this messge below, when we try to connect to a database.
"An item with the same key has already been added."

How can we correct/fix/workaround this?

Comments

  • James BJames B Posts: 1,124 Silver 4
    A common cause for this is if you have more than one file referencing the same object. The extra details on the error may well indicate which object is the cause.
    Did you manually amend any of the files in your source control repository? Such as making a copy of some of the files for backup purposes?

    Another potential is if you have objects named the same apart from their case (upper/lower etc) and you're not using a case sensitive collation.

    Hope that helps - contact us directly at support if you get stuck!
    Systems Software Engineer

    Redgate Software

  • Hi,
    I am also encountering the same issue:
    An item with the same key has already been added.

    Upon opening the SSMS, I see the error:
    Could not load file or assembly 'RedGate.SharedSSMS.VersionSpecific.2014, Version=0.1.0.1137' or one of its dependencies. The system cannot find the file specified.

    And then when I am trying to Commit Changes, the "An item with the same key has already been added." happens.

    Can somebody help please?

    Thanks!
  • I'm surprised you're seeing the error about duplicates- normally the first error (about the missing SharedSSMS file) would stop SQL Source Control loading.

    I'd suggest running a "repair" of the SQL Source Control installation from the add/remove programs option in Windows to see if that fixes the first error. For the second error, try unlinking your database, restarting SSMS and then relinking. That may well fix it, but if not, please email our support team (support@red-gate.com) with details of the error (send in the error report with your email address when prompted as well) and they'll be able to help out.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.