Windows Forms

When I try to add an image to a picture box ,I get the following error message. This error occurs with every control (i.e. with buttons, lables,etc) whithin the solotion. My project contains 4 sub project including a web service.

Error: "An item with the same key has already been added"

How to solve this problem.




Answer this question

Windows Forms

  • cool dude

    I get the same problem (only with picture box). I've checked my images in the ressource file and they are uniquely named. I even deleted all my images and I stil get the same error message.

  • Manoj_Raj

    Have you tried cleaning your solution and then rebuilding it
  • Nick V

    Check your resources to see if an image with that name is already present. It will not allow a duplicate image name in the resources for obvious reasons.

    Phil Wright
    http://www.componentfactory.com
    Free user interface controls for .NET2


  • Flippie

    If this is in 2005 you may have more than one resources file saved with the same name. Look in the projects properties folder. In there is a resource file called Resources.resx, if you also have a resource file with the same name specified in your project, this will be the cause of the problem.

    Either remove your resource file and move your resources the the one in the the properties folder or rename your resource file.


  • Windows Forms