Search stops working for "Entire Solution"

I get that problem once in a while. One seemingly nonsensical solution I've found is to click inside the Find Results window (not the Output window). Once the blinking text cursor is visible, hit Ctrl+Break four or five times. This seems to "unblock" whatever causes the problem.

There are reports Ctrl + ScrLk may need to be used instead of Ctrl+Break . If these doesn't work then try Break alone.

Note from Codeguard: I have found an explanation and deterministic solution to this problem


Windows 7 Pro SP1 64-bit, Visual Studio 9.0.30729.1

Didn't Work:

  • Ctrl + Break
  • Ctrl + Scroll Lock
  • Restart of Visual Studio

Worked:

  • Break (in Find Result 1 & 2) (only pressed once)

Source: Comments in Gordon's link...


Bug source

This is neither Visual Studio nor Windows related bug. In fact, the bug is in your keyboard! Many keyboards from different vendors have been reported to be buggy.

Problem

If you press Ctrl+Break and release Ctrl first, then Break gets stuck on a buggy keyboard. If you ever pressed Ctrl+Break the "wrong" way, you will have this problem with search being interrupted.

Details

According to scan code specifications, Break and Ctrl+Break are special. They send "make" (press) AND "break" (release) scan codes the moment you press Break. They send nothing when you release Break. The buggy keyboard will send the following sequence:

  1. Ctrl "make" scan code
  2. Ctrl+Break "make" scan code
  3. Ctrl "break" scan code
  4. Pause "break" scan code

That is, Ctrl+Break is never released, but instead Pause is released.

Reproduction

You could for example use old good Spy++ from Visual Studio tools. Attach it to anything, for example Windows notepad, and monitor messages (I suggest that you select only keyboard messages). Press Ctrl+Break, releasing Ctrl first. Check the output from Spy++. You will see the sequence I shown in Details section.

I have tried two different keyboards on the same computer. Logitech K120 has the bug while some other Mitsumi keyboard behaves according to specifications and does not have the bug.

If you think about it, it's easy to understand that correct behavior needs special case handling, while buggy behavior is naive. This is why many different keyboards can be buggy.

Solution

Replace your keyboard :)

Workaround

You simply need to press Ctrl+Break, paying attention to releasing Break first. It doesn't matter which application is active.


This bug has been in Visual Studio a long time and it never seems to get fixed.

See this MS Connect item from 2004: http://connect.microsoft.com/VisualStudio/feedback/details/105511/find-in-files-says-no-files-were-found-to-look-in-find-was-stopped

I couldn't believe they still hadn't fixed it in VS2010 - but it's still there :(

The Connect item has been marked as Closed - Won't Fix: https://connect.microsoft.com/VisualStudio/feedback/details/718217/find-was-stopped-in-progress-while-performing-search-in-visual-studio


Ctrl+Break or Ctrl+ScrLk cancel a find operation. Try it. What has happened is that some software layer (presumably Windows) thinks those keys are still being pressed even though they are not. Pressing and releasing them clears the flag.

It could be any of these combinations:

Ctrl+Break

Alt+Break

Break

Ctrl+ScrLk

Remember that you have multiple control and alt keys on your keyboard -- try it with each of them. If it's the right Ctrl key + ScrLk, pressing the left Ctrl is not going to resolve the issue.

Here is the Connect issue which Microsoft closed as "Won't Fix".

If this is a recurring problem for you, there is a Visual Studio extension that suppresses the virtual key that causes the problem.