.net Visual Studio“在文件中查找”不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9207954/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio "Find in Files" does not work
提问by serhio
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 Documentor Current Project.
当我在Entire Solution中的文件中查找(Ctrl+Shift+F)时,Visual Studio (2010, Ultimate) 什么也没找到。但是,它在搜索Current Document或Current Project时发现了 2 次。
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 /resetsettingsbut this didn't help.
我已经这样做了,devenv /resetsettings但这没有帮助。
Example of output of 2 consecutive searches in "all solution":
“所有解决方案”中 2 次连续搜索的输出示例:
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.
查找所有“缩放 -”、子文件夹、打开修改的文件、查找结果 1、“整个解决方案”、“*.vb”
匹配行:0 匹配文件:0 搜索的文件总数:24
正在停止查找。查找所有“缩放 -”、子文件夹、打开修改的文件、查找结果 1、“整个解决方案”、“*.vb” 匹配行:0 匹配文件:0 搜索的文件总数:32
正在停止查找。
I don't know why it says "Find was stopped", because I wait the end of search (don't press any buttons).
我不知道为什么它说“查找已停止”,因为我在等待搜索结束(不要按任何按钮)。
回答by sehe
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.
我找到了一个提示,可以尝试按 Ctrl + ScrollLock 来修复它,它奏效了。
I think most people report success with the (Ctrl-)Breakkey, but some say (Ctrl-)ScrollLockworked instead
我认为大多数人都报告说成功了(Ctrl-)Break,但有些人说(Ctrl-)ScrollLock反而奏效了
回答by makdu
Following worked for me . Visual Studio-->Windows-->Reset Window Panel. The resizing of the visual studio made it to hide the option.
以下对我来说有效。Visual Studio-->Windows-->重置窗口面板。视觉工作室的大小调整使其隐藏了该选项。
回答by JKJ
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.
确保从空格中清除“查看这些文件类型:”框,这将阻止搜索正常运行。
回答by Disillusioned
I experienced a similar but not identical symptoms in VS 2017.
我在 VS 2017 中遇到了类似但不完全相同的症状。
In my case Find in Filessearched 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").
就我而言,在文件中查找搜索了 109 个文件;但这只是解决方案和依赖项中的项目文件。事实证明,有一个选项可以“查看更多结果”,但它模糊地违反了约定,使其不那么明显。更糟糕的是,我发现我必须双击(不仅仅是“单击”)。
Observe the very last line after the summary. When I double-click that line, only thendo I get expected behaviour!
观察总结后的最后一行。当我双击该行时,我才会得到预期的行为!
回答by def
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.
对我来说,一旦我从“查找结果 1 窗口”切换到“查找和替换”结果选项中的“查找结果 2 窗口”,它就开始工作了。
回答by Claus Appel
I fixed this by uninstalling and reinstalling Visual Studio (2017 Professional in my case).
我通过卸载并重新安装 Visual Studio(在我的情况下为 2017 Professional)解决了这个问题。
回答by JimmyV
I had this problem in Visual Studio 2019 Professional. The above solutions did not work for me. I was able to solve this by:
我在 Visual Studio 2019 Professional 中遇到了这个问题。上述解决方案对我不起作用。我能够通过以下方式解决这个问题:
- Press cntl+F to open the find tool window
- Expand the drop down of your search history

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

Somehow, my options got saved as Current Directory and the bin, obj, and packages sub directories.
Change the "Look in" item to any other option and it started to behave as expected.
回答by Tomasz Kot
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->Environment->Preview Features
它也不适用于 VS 2019 (16.6) 我通过切换到“使用以前在文件中查找”来使用解决方法:工具->环境->预览功能
回答by BrinDo
For me the solution was also the one suggested by makdu above (Visual Studio-->Windows-->Reset Window Panel). I'm writing a separate answer just because I am not allowed to write comments yet, as I'm a newbie. I also could not vote for his answer.
对我来说,解决方案也是上面 makdu 建议的解决方案(Visual Studio-->Windows-->Reset Window Panel)。我写一个单独的答案只是因为我还不允许写评论,因为我是一个新手。我也无法投票支持他的回答。
Ctrl+Shift+F was actually working but the "Find and Replace" window was apparently opening somewhere hidden behind the other panes. Reset Window Panel made it open on the front again. I believe this is what makdu was also referring above.
Ctrl+Shift+F 实际上正在工作,但“查找和替换”窗口显然在隐藏在其他窗格后面的某个地方打开。重置窗口面板使它再次在前面打开。我相信这也是 makdu 在上面提到的。

