Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2017 renaming projects - the folder already contains an item named

Tags:

I am reorganizing numerous small solutions/projects into one solution in Visual Studio 2017 but I keep getting error messages like:

The folder already contains an item named 'Staging'

Followed by:

Exception of type 'System.Runtime.InteropServices.COMException' was thrown

The projects are all in individual folders in a folder called Packages with the project folders named like:

  • Staging.Finance
  • Staging.HR
  • Staging.SharePoint

There is no folder called Staging in the Packages folder and there are no files called Staging in the folder for the project I am trying to rename. The project file name is currently Finance-SSIS which I am trying to rename to Staging.Finance.

There is a project called Staging in my solution but this is in a different folder from these projects.

I can rename the project files outside of Visual Studio but want to understand why I'm getting this error.

like image 319
mheptinstall Avatar asked Dec 10 '17 12:12

mheptinstall


1 Answers

Upon searching I came across these three solutions:

  1. Try Restarting Visual Studio.

  2. Open Solution Explorer there is an icon that looks like a many Pages enter image description here 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

  3. A project can exist in a solution in only one location. To correct this error: To show hidden Solution Folders, select the solution or a Solution Folder that contains a hidden Solution Folder and then on the Project menu, select Unhide Folders.

Credits for solution 1 & 2: See original answers

Credits for solution 3: See original post

like image 152
Javapocalypse Avatar answered Sep 22 '22 09:09

Javapocalypse