I try to add a new file to my source controlled VS2012 solution and receive this message:
A file or folder with the name 'xxx' already exists. Please give a unique name to the item you are adding, or delete the existing item first.
I'm 100% sure that there is no file with the given name.
So how do I get VS to add items again?
If you were to create a same file that has the same name to it then your computer would recognize the file with the same name and will ask you whether you would like to replace the existing file or if you would like to make duplicate copy of the existing file.
Some folders already exist in File Explorer, such as Documents, Desktop, and Downloads. (Documents may be called “My Documents” in older versions of Windows). You can create more folders or folders within folders to allow for better organization. To create a folder, right-click, then select New>Folder.
Right click the project or contained folder and choose Add | Existing Item... . Use Show All Files . Click on files or folders you would like to add to the project and choose Include In Project . Drag and drop files and folders from Windows Explorer.
No. You should not delete.
Restarting Visual Studio didn't help, the folder is cached on the system.
Open Solution Explorer
there is an icon that looks like a many Pages: which is the Show All Files
. Once clicked, one is able to see the hidden, to the visual studio project, the folder that was causing this error. (Look for the folder in the View section.)
After I deleted the unwanted folder, and Rebuild Project, You should be able to Create the controller which will create the view automatically...
Restarting Visual Studio helped me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With