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.
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.
I have the same problem, but its a pain having to keep hiding the folder everytime I need to bvuild the project - In the end I just excluded all the files in the folder individually
You can exclude the top level folder only and Visual Studio will not read the files under that directory. This is quicker than hiding the top level folder and the sub folders.
jbardrof
Member
638 Points
192 Posts
Exclude Folder from Website in Visual Studio
Nov 06, 2007 11:19 PM|LINK
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!
Joël Hébert
Contributor
4624 Points
679 Posts
MVP
Re: Exclude Folder from Website in Visual Studio
Nov 07, 2007 03:03 AM|LINK
i see what you mean a class library has exclude from project and i was looking at the vc web project and i cant see anything for folder exclusion
Opulent ASP Development Inc.
www.opulentasp.com
Ottawa,Canada
Click "Mark as Answer" on the posts that helped you to help future readers to get the solutions
Benson Yu - ...
All-Star
34797 Points
2497 Posts
Re: Exclude Folder from Website in Visual Studio
Nov 09, 2007 04:46 AM|LINK
Hi jbardrof,
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.
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.
dotnet_lee
Member
467 Points
207 Posts
Re: Exclude Folder from Website in Visual Studio
Jun 17, 2008 02:16 PM|LINK
I have the same problem, but its a pain having to keep hiding the folder everytime I need to bvuild the project - In the end I just excluded all the files in the folder individually
jwbthree
Member
4 Points
5 Posts
Re: Exclude Folder from Website in Visual Studio
Mar 05, 2009 07:13 PM|LINK
You can exclude the top level folder only and Visual Studio will not read the files under that directory. This is quicker than hiding the top level folder and the sub folders.
Achaemenidia...
Member
2 Points
2 Posts
Re: Exclude Folder from Website in Visual Studio
Oct 29, 2009 11:14 AM|LINK
Simply convert those folder(s) into "application" in IIS and VS won't load those folders anymore.
FirstPost!
charliemonte
Member
8 Points
4 Posts
Re: Exclude Folder from Website in Visual Studio
May 21, 2010 06:40 PM|LINK
Nice, thanx Benson Yu!!!
Diomedes
Member
202 Points
145 Posts
Re: Exclude Folder from Website in Visual Studio
Aug 23, 2010 06:24 PM|LINK
Ok, This is an old post, but since I found it looking for the answer....
What work for me, on VS2010 was to change the folder name and add an _ to it.
Example:
TestFolder
Rename to:
_TestFolder
thus making it a private/invisible folder.
clevy
Member
4 Points
3 Posts
Re: Exclude Folder from Website in Visual Studio
Mar 16, 2011 05:36 PM|LINK
Simply adding and underscore to the folder name does NOT exclude it from a publish of the website in VS 2010