Related Links

Exclude Folder from Website in Visual Studio

For projects such as forms apps and class libraries you can exclude folders which reside in the directory from the project. That menu option does not seem to exist when you create a website in VS 2005, is there any way to do it?

thanks!

Remember if you have gotten your answer to mark your thread as answered.

Re: Exclude Folder from Website in Visual Studio

This is the by design behavior of website type project (The web application type project still has the “Exclude From Project” menu item). It’s because website project lack of the project file. The include/exclude information store in the web application
project file (*.csproj) but website project doesn't have it.

To workaround this issue, we can set “Hidden” attribute for the file/folder which you want to exclude from project, and the refresh the project in Solution Explorer. For example:

1. Open Windows Explorer.
2. Local to the physical folder of your website.
3. Right click the file/folder which you want to exclude, and then select “Properties”.
4. Check the “Hidden” attribute.
5. Click the “Refresh” button in the Visual Studio 2005 Solution Explorer.

Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.