Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I am getting an error in visual studio when i try to add a new class to the project:

Cannot add the item. There already exists an item with the same name under source control that prevents this add operation from continuing. Please rename the item and try adding it again.

I cannot see this file anywhere so don't know why it will not let me add it.
Doses anyone know what's going on here?

Thanks george
Posted

Is it right in suggesting that you're using source control?

Chances are that you may not have it in your project locally, but someone else has left an orphaned copy of the file on the source control server in the project folder you're working in.

What are you using for source control? You should be able to browse the server and see if there is a matching file.
 
Share this answer
 
I am using source control for the whole solution.

There are two separate teams working on a branched project. The other branch has this file in it although allot of the other files are the same in both so its a bit odd.

I don't know how i would do that but will give it a go. I have already searched my machine for the file so could be somewhere on the server, i will try and search for it.

Thanks for the advice George
 
Share this answer
 
Comments
Toli Cuturicu 12-Aug-10 10:23am    
Reason for my vote of 1
fake answer
TheyCallMeMrJames 12-Aug-10 10:50am    
@gwithey...what Toli is saying is that you're supposed to use comments on the other answers if you want to have a conversation. You can't get points for answering your own questions, so I upvoted to negate the 1-score.
TheyCallMeMrJames 12-Aug-10 10:52am    
Reason for my vote of 5
upvote
TheyCallMeMrJames 12-Aug-10 10:55am    
I think I've also run into this where someone else added a file to a project, checked in their work, then removed the file from the project but didn't delete it from source control. When you get latest version, you'll be without the file that's been 'removed', but won't be able to check in a file with the same name. Hth.
gwithey 12-Aug-10 11:10am    
I get it, i didnt understand how everything worked since the site changed, i think you are right just dont know how to fix it, the problem only occurs in one project of my solution. I can add the class to any other

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900