VS2017 重命名项目 - 文件夹已经包含一个名为的项目

mhe*_*all 5 visual-studio-2017

我正在 Visual Studio 2017 中将许多小型解决方案/项目重组为一个解决方案,但我不断收到错误消息,例如:

该文件夹已包含名为“暂存”的项目

其次是:

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.

Jav*_*pse 4

经过搜索,我发现了这三种解决方案:

  1. 尝试重新启动 Visual Studio。

  2. 打开解决方案资源管理器,有一个看起来像很多页面的图标在此输入图像描述哪一个是Show All Files。单击后,就可以在 Visual Studio 项目中看到导致此错误的隐藏文件夹。(在“视图”部分中查找该文件夹。)。删除不需要的文件夹并重建项目后,您应该能够创建将自动创建视图的控制器

  3. 一个项目只能存在于一个解决方案的一个位置。要更正此错误: 要显示隐藏的解决方案文件夹,请选择解决方案或包含隐藏解决方案文件夹的解决方案文件夹,然后在“项目”菜单上选择“取消隐藏文件夹”。

解决方案 1 和 2 的学分:查看原始答案

解决方案 3 的制作人员:请参阅原始帖子