Master
Master

Reputation: 2163

Cannot add file to solution: "A file or folder with the name [name] already exists"

When I attempt to add any file to my project, I get this error:

A file or folder with the name azazaz.cs already exists.

Please give a unique name to the item you are adding, or delete the existing item first.'

There have been no updates to Visual Studio recently. The problem only occurs in this one project. It works properly on other computers.

What I've tried so far:

I can't really start over and create a new project.

Upvotes: 6

Views: 11016

Answers (3)

Abhishek P
Abhishek P

Reputation: 80

Go to that project folder location and delete the same project you have created. Issue is that, you might have created one project with same name and removed it. but that project exists in location. So first delete it and create new one. ask me anythins is confusing.

Upvotes: 1

Amin Uddin
Amin Uddin

Reputation: 1006

Open your project .csproj file in notepad. After that delete azazaz.cs from references.

Upvotes: 2

Srikanth
Srikanth

Reputation: 1010

Delete the "ComponentModelCache" folder under the below mentioned path and restart Visual Studio. For my install of Visual Studio 2012 the following is the path. Search according to your Visual Studio version.

“C:\Users\ic016028\AppData\Local\Microsoft\VisualStudio\11.0\”

Upvotes: 5

Related Questions