Undo VS 'Exclude from project'?

Visual Studio

Visual Studio Problem Overview


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

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

Visual Studio Solutions


Solution 1 - Visual Studio

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

Solution 2 - Visual Studio

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

Solution 3 - Visual Studio

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

Solution 4 - Visual Studio

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

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".

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.

Solution 5 - Visual Studio

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionUpTheCreekView Question on Stackoverflow
Solution 1 - Visual StudiocaptncraigView Answer on Stackoverflow
Solution 2 - Visual StudioChanuka AsankaView Answer on Stackoverflow
Solution 3 - Visual StudioChrisFView Answer on Stackoverflow
Solution 4 - Visual StudioCapt. RochefortView Answer on Stackoverflow
Solution 5 - Visual StudioComeInView Answer on Stackoverflow