Tuesday, April 29, 2008

How To Hide A Folder In A Website And Exclude It From VSS Too [Visual Studio.NET]

Microsoft ASP.NET LogoIn any project of Visual Studio.Net environment excluding a folder is very simple. We just need to right click on the folder and select Exclude from Project. But in Website of Visual Studio.NET it is not that easy to hide a folder and also there is no direct way to exclude a folder from Website.

The easy way to exclude an unwanted folder from a website  is to physically delete the folder from the website structure. But what if you should not delete the folder from the website structure? Here is a simple trick to hide(not deleting) a folder from Visual Studio.NET editor as well as from Visual Source Safe.

Set Hidden attribute for the folder which you want to exclude from project, and the refresh the Website(project) in Visual Studio.NET Solution Explorer. Here are the detailed steps to be followed

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

Using this simple trick you can even hide files of a website from Visual Studio.NET environment.

1 Comment:

Anonymous said...

Thanks, worked like a charm. Saves me accidently checking in uploaded test files in my project.