visual-studio 撤消VS“从项目中排除”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1352554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:55:53  来源:igfitidea点击:

Undo VS 'Exclude from project'?

visual-studio

提问by UpTheCreek

Is there a way to undo the 'exclude from project' operation in Visual Studio (2008) ?

有没有办法在 Visual Studio (2008) 中撤消“从项目中排除”操作?

How to include files back into the project after excluding them?

排除文件后如何将文件包含回项目?

回答by captncraig

Make sure you are showing all files. There is a button at the top of the Solution Explorer called "Show All Files". To see this button, make sure that your project is selected in the solution explorer.

确保您正在显示所有文件。解决方案资源管理器顶部有一个名为“显示所有文件”的按钮。要查看此按钮,请确保在解决方案资源管理器中选择了您的项目。

Show All Files
enter image description here

显示所有文件
在此处输入图片说明

When this option is active, the file should be there, just grayed out. Right click it, and select "Include In Project".

当此选项处于活动状态时,文件应该在那里,只是变灰。右键单击它,然后选择“包含在项目中”。

Include In Project
enter image description here

包含在项目中
在此处输入图片说明

回答by Chanuka Asanka

Visual Studio Express 2012

Visual Studio Express 2012

Select Your Project Folder Click On "Show All Files" icon to show all Excluded Folders And Files

选择您的项目文件夹单击“显示所有文件”图标以显示所有排除的文件夹和文件

Click On Show All Files icon to show all Excluded Folders And Files

单击“显示所有文件”图标以显示所有排除的文件夹和文件

Then Right Click on Excluded Folder or File and Click on "Include In Project"

然后右键单击排除的文件夹或文件,然后单击“包含在项目中”

enter image description here

在此处输入图片说明

回答by Capt. Rochefort

I couldn't find the "Show All Files" button in Visual Studio 10 when I ran into this problem.

遇到此问题时,我在 Visual Studio 10 中找不到“显示所有文件”按钮。

Another way to solve it is to open the containing folder in Windows Explorer by right clicking the folder in Solution Explorer and selecting "Open Folder In Windows Explorer".

解决此问题的另一种方法是通过右键单击解决方案资源管理器中的文件夹并选择“在 Windows 资源管理器中打开文件夹”,在 Windows 资源管理器中打开包含的文件夹。

Find the folder you want to add back into the project and Drag/Drop it from the Explorer window into your Solution Explorer in Visual Studio.

找到要添加回项目的文件夹,然后将其从资源管理器窗口拖/拖放到 Visual Studio 中的解决方案资源管理器中。

回答by ComeIn

Add existing will not work if it is a folder that you excluded.

如果它是您排除的文件夹,则添加现有将不起作用。

回答by ChrisF

In the absence of an actual undo option you could select Add > Existing Item...to re-add the item you've just excluded.

如果没有实际的撤消选项,您可以选择Add > Existing Item...重新添加刚刚排除的项目。