Limit search to specified folders or file types in Visual Studio?

Is there a way to limit the search (through the Find and Replace dialog box) in Visual Studio to the specified folders or file types?

+58
find search visual-studio-2008 visual-studio
Apr 27 '09 at 23:34
source share
5 answers

Yes, in the search / replace window, you can:

  • specify file types in the "Look at these file types" option
  • and select the folders in the button ... of the "Search" option.

Find and Replace Window

+74
Apr 27 '09 at 23:38
source share
  • Click Find Files
  • Select the search folders with three dots "..."
  • Select the desired folder
  • Check the folder name and click the desired action.

Click

Select Search Folders

Select the desired folder Check the folder name and click the desired action

+17
Dec 07 '15 at 11:12
source share

I can't believe this question still exists in VS2015. We have a decision directory tree. Why "Current Selected Folder" is not an option in the drop-down list. "..." does not start by default in the solution folder, I have to browse the entire network to a shared resource, and then browse all the folders to get to the folder, which is ALREADY, right there and selected in the solution explorer. Dreamweaver has this search functionality for at least a decade (possibly longer).

+16
Mar 22 '16 at 21:56
source share

The fastest folder search in VS:

As stated in other answers, there is no immediate way to limit your search to a specific folder in the current solution. (There are at least 3 feature requests for visualstudio.uservoice.com that were closed due to lack of votes.)

But here is the fastest workaround I could find.
It works without leaving VS and only with keystrokes (without mouse actions):

  • In Solution Explorer, select the folder to search.
  • Press Ctrl-C (copies the path to the folder to the clipboard).
  • Press Ctrl-Shift-F to open Find in Files.
  • Enter a search term, then press the Tab key to move the cursor to the Search In field.
  • Press Ctrl-V to paste the path to the folder from the clipboard.
+4
Jan 10 '19 at 10:48
source share

While choosing search folders, it can be much better. I would really like to select folders for exclusion, as well as include, because sometimes folders are nested. You may need a folder, but only some of the subfolders.

But the most dangerous inconvenience is that it is not stored with the solution. If I am faced with the problem of defining a search and closing VS, and then reopening it, I have to define it entirely.

0
Apr 6 '16 at 13:07 on
source share



All Articles