Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Silverlight in Visual Studio 2010 freezes when using keyboard

First I'd like to head off the "wait a minute" questions.

  • Yes, I've read every thread with similar titles and subjects on SO and beyond.
  • Yes, I'm using the very latest version of SP1 and any potential hotfixes that might be related to this problem.

So, with specificity, here is my problem:

When I'm debugging Silverlight applications and it hits a breakpoint, everything works just fine as long as I use the mouse. I can continue, step, stop debugging, disable and enable breakpoints all just fine -- as long as I do so with the mouse.

But when I use the keyboard, Visual Studio freezes for a number of seconds, sometimes over a minute. This is any use of the keyboard. But after a short time, it starts to work just fine until that debugging session is over. But the next debugging session (regardless of whether I use the same instance of Casini or not) it will do exactly the same thing.

When I say any keyboard use, I mean it. F5 (Continue), Shift-F5 (Stop Debugging), F10 (Step Over), as well as typing in the Immediate window or even hitting the ALT key to highlight the menu.

For instance, if I try to type something in the Immediate window, it freezes for about 15 seconds and then shows the first key and repeats the pattern about 5 times until it releases and everything is just fine.

When I say "freezes" I'm not talking just Visual Studio but it hangs the entire operating system except for my ability to move the mouse. Even so, the mouse cursor remains what it was when it froze regardless of the program it's over, such as the text selector.

It only happens with Silverlight and it doesn't matter which version I use.

Here's what I'm running:

  • Windows 7 Professional 64-bit, all of the latest updates included, 12 GB RAM & 1.5 TB HD.
  • Visual Studio 2010 Ultimate with all of the latest updates.

All software is legit and I've already tried removing and/or disabling just about everything that can be removed or disabled, including extensions. I've used Process Explorer from Sysinternals to kill or stop everything I can. I've also tried it on a very simple Silverlight application with nothing more than one line of code that doesn't access anything.

EDIT: Forgot to mention that I also don't have it loading symbols beyond the "Just My Code" that it normally would and I've tried every debug setting that I can think of as well. And Intellitrace is also turned off (since I do have Ultimate), but that makes no difference either.

UPDATE (11/18): It gets more and more odd. I determined that the temporary freeze doesn't occur only when Visual Studio has focus. When VS (during the super-simple Silverlight app) goes into debug mode, any keyboard access AT ALL causes the same effect. SO, it appears that it has to (in some way) be related (at least in part) to my Windows setup, contrary to my assertion in the comments, but I cannot possibly fathom how. And if other programs are doing something when it freezes, the delay is longer (which makes a certain amount of sense with the symptoms). I'm still at a complete loss.

Anyone have any ideas or see this before? It's really frustrating.

like image 237
Chris E Avatar asked Nov 16 '11 18:11

Chris E


2 Answers

I solved the problem.

It turned out to be the LastPass toolbar. It's a very handy thing and I've used it for years without issue. Yeah, yeah, toolbars are evil, I get it. :)

Disabling it in IE fixed the problem completely. I can still use it in FF (which is my main browser anyway except for working for which I use IE) and everything works fine.

Even so, it's bizarre to me that the toolbar would only have an effect when SL debugs. I didn't have an issue with ASP.Net debugging and I didn't any issues when the SL app was actually running, only when I hit a breakpoint AND hit a key within the first 15 seconds or so.

In any case, problem solved and thanks for your suggestions.

like image 197
Chris E Avatar answered Nov 18 '22 21:11

Chris E


Try changing registry setting LowLevelHooksTimeout from 5000 to something low, like 300. It can be at

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\Control Panel\Desktop 

or

HKEY_CURRENT_USER\Control Panel\Desktop

(first setting at Policy key seems to globally override user setting).

like image 35
Anton Breusov Avatar answered Nov 18 '22 19:11

Anton Breusov