45

One day, in VS2010, I was using the "Find in Files" tool.

I set the "Look at these file types" option to *.sql. Ever since then, when I bring up the tool, it will randomly default the file type to either *.sql, or blank. I want it to always default to blank.

The "bug" happens across different solutions.

Does anyone know why it's randomly resetting to *.sql and how I can get it to stop?

Rob
  • 26,989
  • 16
  • 82
  • 98
Walter Stabosz
  • 7,447
  • 5
  • 43
  • 75

4 Answers4

50

I'm not sure why it's behaving randomly. My VS2010 always uses the last file filter I entered, although unfortunately it won't seem to remember me clearing out the option.

To revert it back to blank, use regedit.exe and navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find. Edit the value named "Filter" and set the data to blank.

Next time you change it to *.sql, though, Visual Studio will store it and remember it.

  • Yup, I figured out the registry hack. Thanks for confirming that it works for you. Now it's stuck on *.vb :) – Walter Stabosz Apr 12 '12 at 21:28
  • 1
    Just happened to me on VS2012. Answer is the same except it's under \11\ – Chris Marisic Jun 05 '13 at 19:20
  • 8
    I call this a bug, and it's an especially annoying one since it only seems to remember what you did last when it's inconvenient, and never when it would be useful. – Tom W Jan 07 '14 at 09:35
  • 2
    I call it a bug too, because while remembering last filter could be handy at times, there is no way to NOT remember and clear the filter history. Oh, and it still happens in VS2013! – gitsitgo Sep 05 '14 at 15:11
  • 1
    Same for VS 2013, under \12.0\Find – Steve Oct 12 '15 at 13:56
  • Bugged me in VS2010, then again in VS2012, then again in VS2015, now it bugs me in VS2017, christ. What is it? Oldest bug competition? – quetzalcoatl Mar 19 '18 at 11:04
31

Duh, change the filter to * and Visual Studio will remember it and it will perform an unfiltered search. Not sure why I didn't think of it sooner.

Walter Stabosz
  • 7,447
  • 5
  • 43
  • 75
  • 11
    Nice workaround, but just emphasises how stupid this behaviour is. – Tom W Jan 07 '14 at 10:01
  • 8
    If only that worked. I set it to `*` many times. It always reverts back to 'spec*.cs' from that ONE TIME MONTHS AGO THAT I WANTED TO SEARCH FOR THOSE FILES!!! – Ronnie Overby Feb 10 '15 at 20:25
15

This happens in Visual Studio 2017 as well, and I can't find the registry to clear. My workaround is to set the file type to *.* instead of clearing it.

Greg
  • 186
  • 1
  • 3
  • 1
    This worked in 2017 for me, which is nice as it is the simplest solution. Setting it to `*` alone did not work for me. – Tim Jun 02 '17 at 17:30
  • 3
    Apparently Visual Studio 2017 uses a private registry... you can find the keys described in other answers there https://stackoverflow.com/a/41122603/1328536 – fuchs777 Jul 27 '17 at 09:21
7

Visual Studio has the "feature" of storing this information in the registry. You can change the registry manually, but since we need to change the registry after every filtered search, it is useful to have a .reg file to do it.

Save as 'Reset Search in Visual Studio.reg':

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Find]
"Query"="Entire Solution"
"Filter"=""
"Filter 0"=""

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Find]
"Query"="Entire Solution"
"Filter"=""
"Filter 0"=""

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find]
"Query"="Entire Solution"
"Filter"=""
"Filter 0"=""
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
ChiokJarse
  • 101
  • 1
  • 5