Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell Visual Studio to exclude folders from the Find in Files?

We use subversion so we have subfolders named _svn in our solution. Doing a Find in Files returns strings from these subfolders. Is there any way to tell Visual Studio to ignore these files?

like image 649
Bernard Avatar asked Oct 22 '09 13:10

Bernard


People also ask

How exclude folder from search VS Code?

To exclude a folder, go to File > Preferences, and search for file. exclude in the search settings. You can add the pattern of the folder you don't want Visual Studio Code to open.

How do I exclude files from a folder?

Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection. Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions. Select Add an exclusion, and then select from files, folders, file types, or process.


2 Answers

From "Find in Files", in "File Types" or "Look at these file types", you can use:

!*\ExcludeFolder\*

Example:

!*\bin\*;!*\obj\*;!*\.*;!*\ExcludeFolder\*

enter image description here

like image 85
A. Morel Avatar answered Oct 07 '22 07:10

A. Morel


What you can do is to setup a set of folders that will be used for searching. In Find and Replace window, on the right hand side of "Look In" input you have a "Choose Search Folders" option where you can setup those sets of folders.
Just remember to turn off "Include sub folders" options if you have added root project folder.
If you don't have hundreds of folders this solution should work.

like image 32
rafbel Avatar answered Oct 07 '22 07:10

rafbel