PDA

View Full Version : How do I prevent the 'Item has already been added." error building VS.NET solutions?


kinook
04-08-2003, 10:52 AM
This will happen if there are two or more projects in the same solution with the same ProjectGUID (most likely caused by a project being copied and renamed). This really isn't a valid situation, but for some reason the VS.NET IDE doesn't complain about it (although you can run into problems with dependencies and configurations, since the project GUID is used to identify that information in the SLN file). Our Make VS.NET action uses the GUID as a key, so the GUIDs need to be unique within a solution.

To resolve the problem, locate the name of the first project with the duplicate project GUID (by opening the SLN file in a text editor and searching on the GUID from the error string); open the solution in VS.NET and remove that project from the solution; open the just-removed project file in a text editor, delete the ProjectGUID attribute, and save the file; re-add the project to the solution and save the solution (the project file will also be saved with a new Project GUID).