54

Visual Studio (2010, Ultimate) finds nothing when I do Find in Files (Ctrl+Shift+F) in the Entire Solution. However, it finds 2 occurrences when searching Current Document or Current Project.

I see that the "Total files searched" in the output window is a random number, and does not correspond to the number of files in my solution (is much smaller).

I already did devenv /resetsettings but this didn't help.

Example of output of 2 consecutive searches in "all solution":

Find all "zoom -", Subfolders, Keep modified files open, Find Results 1, "Entire Solution", "*.vb"
Matching lines: 0 Matching files: 0 Total files searched: 24
Find was stopped in progress.

Find all "zoom -", Subfolders, Keep modified files open, Find Results 1, "Entire Solution", "*.vb" Matching lines: 0 Matching files: 0 Total files searched: 32
Find was stopped in progress.

I don't know why it says "Find was stopped", because I wait the end of search (don't press any buttons).

burnttoast11
  • 1,164
  • 16
  • 33
serhio
  • 28,010
  • 62
  • 221
  • 374
  • Possible duplicate of *[Search stops working for "Entire Solution"](http://stackoverflow.com/questions/892126/search-stops-working-for-entire-solution)*. – Peter Mortensen Feb 10 '17 at 12:27

17 Answers17

60

I think I recognize this wellknown, longstanding bug:

The workaround mentioned there worked for me when I had this problem

I found a tip to try pressing Ctrl + ScrollLock to fix it, and it worked.

I think most people report success with the (Ctrl-)Break key, but some say (Ctrl-)ScrollLock worked instead

thelem
  • 2,642
  • 1
  • 24
  • 34
sehe
  • 374,641
  • 47
  • 450
  • 633
  • 7
    My GOD!!! Thanks for the link! In my case the problem went away after I press `Break`.... So, if you have a problem in Visual Studio the solution is: `press any key to fix the bug` – serhio Feb 09 '12 at 09:57
  • 1
    (Ctrl)+Break worked for me...there are few bugs annoying as undocumented keystrokes. – MW_dev Apr 15 '13 at 04:07
  • 4
    @Coda to be fair, this isn't an undocumented feature AFAIAC, this is just a "Heisenbug" that is somehow _sometimes_ (dis)armed using combinations involving the `Break` key... Yeah. It's vague! MAD PROPS to the VS team to keep the bug around from VS2003 (perhaps even VS6?) despite all the changes the UI underwent :) – sehe Apr 15 '13 at 07:04
  • 2
    Comment from @polygox: When using a RDP client (mstsc) for accessing Visual Studio, I had to use the on-screen keyboard to be able to send the combination. – Gray Jun 05 '13 at 12:52
  • I have been frustrated for the past 10 days with this error message and was going to re-install VS2010. Luckily i stepped into this forum and Ctrl+Scroll Lock worked like a champ. Thank you so much. –  Oct 09 '13 at 16:57
  • Awesome fix! Very intuitive to fix it, but it worked for me also. :) I wonder what other hidden features I might find next. – lex87 Oct 31 '13 at 14:32
  • 6
    Man, does not work for me. Looks like this one has been carried with it to 2013 update 1 :( I've tried ctrl-break, ctrl-scroll 10 times both with and without the search window open but to no avail.. – Stígandr Feb 18 '14 at 09:35
  • Keys in this answer didn't directly help me in 2013 Update 2, although after trying them for a while VS decided to restart - that fixed it. – ErikE Jun 12 '14 at 14:19
  • Just encountered this in 2013 Pro. Thought I was doing something wrong; didn't expect to find out that it was a bug. Crazy. :/ – Toby Deshane Nov 03 '14 at 05:55
  • VS 2015 Update 2 checking in! – Den Aug 09 '16 at 13:11
  • 6
    Link no longer works. VS 2015 - neither ctrl-scolllock nor ctrl-break work. – CramerTV Sep 08 '17 at 23:31
  • @CramerTV For you. We can't blame MS for not keeping their perma-links to bugs of ~15 years old alive... Found this link that's still relevant https://msdn.microsoft.com/en-us/library/z613zk0e.aspx – sehe Sep 08 '17 at 23:33
  • @CramerTV By the way it looks like the entire issue-reporting site is down with "system errors" at the moment. Here's the wayback-machine. [It is reported against VS2005 in 2004](https://web.archive.org/web/20100617142305/http://connect.microsoft.com/VisualStudio/feedback/details/105511/find-in-files-says-no-files-were-found-to-look-in-find-was-stopped) – sehe Sep 08 '17 at 23:41
  • 2
    OMG! The popup was on my other monitor. 8^D – CramerTV Sep 08 '17 at 23:46
  • Try a different keyboard. It's deffo still supposed/reported to work. – sehe Sep 08 '17 at 23:47
  • @thelem Nice touch with the webarchive link, thanks! – sehe Dec 13 '19 at 16:35
  • Partially worked for me. VS 2022 still doesn't find everything 2019 does though. 10 of the 22 instances. – Craig Apr 20 '22 at 00:02
  • @Craig For me, Visual Studio 2019 would only find "IEnumerable" in *.tt" files in the entire solution if I had the files already open! Visual Studio 2022 found others (although maybe not all of them!). Interestingly, if I changed the search term to something else I knew existed in those files, I got a lot more results back in 2019, albeit, far fewer than 2022. Then I closed all of the files I had open in 2019, ran the search again and got the same number of results back as 2022! – Matt Arnold Mar 22 '23 at 12:12
17

This is obviously a way late answer but I did get here while looking for a solution to a somewhat similar issue and I'd like to share the fix which eventually worked:

Make sure you clear the "Look at these file types:" box from whitespaces which will prevent the search from running properly.

JKJ
  • 535
  • 4
  • 14
  • Thank you for the answer. As you can see from the OP the file types is set to `*.vb` so this is a solution, but not for the OP problem. – serhio Dec 19 '18 at 09:23
  • 3
    some weird character was present in the file types box after upgrading to vs 2019. Thank you. – Elger Mensonides Apr 30 '19 at 08:32
  • 1
    This is what fixed it for me, too. Exactly as @elger-mensonides mentioned, there was a weird character (the little square in my case) after upgrading to VS2019. Even after removing the character I find it still comes back from time-to-time, too. – mafbailey Oct 11 '19 at 14:27
  • This is what did it for me - thank you. My Find window would just spin it's status indicator forever. Clearing out the space did the trick. – jaredbaszler Feb 13 '20 at 04:21
  • Grrr. Not the first time this has tripped me up. Briefly double-clicked by accident and changed the file filters...lol. – Chef Pharaoh Oct 15 '20 at 22:14
12

Like many other problems where VS simply stops to work properly, deleting the solutions .vs (located in the solution directory) seems to be a 'valid option'.

CAUTION: this will cause you to loose:

  • breakpoints
  • tabs / open documents
  • currently set build configuration
  • other non-vital information

... along with a lot of wrongly cached information that VS successfully managed to pile up leading to wrong find results.

I do this regularily when i encounter extreme lags even in debug-startups.

Roman Pfneudl
  • 707
  • 1
  • 8
  • 21
  • 2
    Thanks, this helped for VS2022 17.1.1. It’s a shame Microsoft keeps breaking critical features in all their desktop-targeted products, including the OS itself. – Soonts Mar 23 '22 at 14:02
  • Thank you @Roman. Sometimes I forget that there are shortcuts for bugs! – Mohsen Afshin May 10 '22 at 09:08
10

Following worked for me:

Visual Studio → WindowsReset Window Panel.

The resizing of the visual studio made it to hide the option.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
makdu
  • 908
  • 2
  • 13
  • 26
  • 3
    "The resizing of the visual studio made it to hide the option." - which option? This has nothing to do with the question. The question is _not_ about being able to see/find the button for find in files, and makes that very explicit in the question text. The visual reset described in the question would certainly do the reset your answer describes. – sehe Jun 22 '16 at 20:53
  • Did _not_ help in my case, too. – Uwe Keim Mar 09 '23 at 08:26
8

It's also not working for me on VS 2019 (16.6) I use a workaround by switching to "Use previous Find in Files": Tools->Options->Environment->Preview Features

JotaBe
  • 38,030
  • 8
  • 98
  • 117
Tomasz Kot
  • 193
  • 2
  • 7
4

I had this problem in Visual Studio 2019 Professional. The above solutions did not work for me. I was able to solve this by:

  1. Press CTRL+F to open the find tool window

  2. Expand the drop down of your search history Find drop down

  3. At the bottom of the drop down you should see Search Options and under that Find in Files..Find and Replace options

    Somehow, my options got saved as Current Directory and the bin, obj, and packages sub directories.

  4. Change the "Look in" item to any other option and it started to behave as expected.

Meric Ozcan
  • 678
  • 5
  • 25
JimmyV
  • 493
  • 3
  • 12
2

I experienced a similar but not identical symptoms in VS 2017.

In my case Find in Files searched 109 files; but that was only project files in the solution and dependencies. It turns out there is an option to "see more results", but it obscurely violates conventions making it less obvious. And to make it worse, I found I had to double-click (not just "click").

Observe the very last line after the summary. When I double-click that line, only then do I get expected behaviour!

Find in Files

Disillusioned
  • 14,635
  • 3
  • 43
  • 77
2

Visual Studio 2022 Community Edition v17.2.5

i uninstalled pro version and installed community, only solution worked for me is:

File Types : *.*

Ali Karaca
  • 3,365
  • 1
  • 35
  • 41
1

Visual Studio 2022. Tried all of above and none worked for me. What did work for me was clicking "Use Regular Expressions" even though I wasn't using regular expressions. Once I did that, it started working.

Brian Cao
  • 31
  • 1
  • This worked for me! Obviously you have to make sure your search is now a valid Regular Expression... but that's easy if your search string is just plain text (words, numbers, spaces) and no symbols. Another solution (without changing to Use Regular Expressions) is to change the "Look In" to "Current directory" (if possible for your project.) – Kane Shaw Jun 05 '23 at 15:39
0

For me it started to work once I switched from "Find results 1 window" to "Find results 2 window" found in "Find and Replace" results option.

def
  • 521
  • 4
  • 16
0

I fixed this by uninstalling and reinstalling Visual Studio (2017 Professional in my case).

Claus Appel
  • 379
  • 1
  • 4
  • 13
0

It's silly, but what fixed it for me was prefacing the file extensions with an asterisk under Look at these File types e.g.: *.js; *.aspx instead of just .js; .aspx Maybe try *.* if you're having this issue.

BrentC
  • 1
  • 1
0

I just fixed mine by deleting and re-creating the solution/project files. Nothing else worked (ie: no button presses, window reset. restarting VS and the PC)

A symptom of the issue I had was that it was only not finding stuff from certain projects, but was able to find the same text if it was referenced in other projects (ie: as if Find in Files was disabled for just one project/directory tree).

So if you have the same symptom and nothing else works then try this solution and let me know if that helps.

Miko
  • 33
  • 4
0

For me I just Change file types!!!

my version of visual studio is 16.11.9

enter image description here

0

I met this problem when I was debuging 2 solutions, one of which was csharp and another was cpp. When I did the search in the cpp solution, the "file types" were still ".cs;.cshtml...". Switching to "*.cpp;..." fixed the problem.

Because I usually work in csharp, and it did take me quite a time to realized it.

cheny
  • 2,545
  • 1
  • 24
  • 30
0

"Include miscellaneous files" works for me.

enter image description here

Mitko Keckaroski
  • 954
  • 1
  • 8
  • 12
0

Make sure you are searching the Entire Solution and that you tick both of the options Include external files and Include miscellaneous files.

KeyC0de
  • 4,728
  • 8
  • 44
  • 68