Tuesday, December 6, 2011

Visual Studio 2010 Screen Redraw Hell

If you have been having problems with Visual Studio 2010, then maybe you have the same problem I had.

Lately I've been having all sorts of problems with Visual Studio 2010 (Ultimate) at work. It's been making me miserable. I believe some days my problems have made my team miserable too. You see, I'm not the sort of person to stoically endure a bad situation quietly when I could trumpet my dissatisfaction to anyone within earshot.

My problems start when I get the latest changes from Team Foundation Server. TFS is ... well, you wouldn't have read this far if you didn't know what TFS is, so let's skip that part. Anyway, if I can get past getting latest then depending on how long it's been since I last got latest I'm usually onto the resolve conflicts "dialog". Why the scare quotes? A dialog is when (at least) two people are talking. This is when the pain hits.

A series of small dialogs appears, advising of merge conflicts, or asking whether to accept the merge resolutions I have just made. This is when all crap breaks loose and Visual Studio/TFS starts hanging, crashing, not responding, and generally wrecking my buzz. I can accept a merge resolution by clicking 'Ok', only to have that window reappear and ask the same question over and over - just like my 4-year old son Eoin - before the whole mess o'windows becomes totally unresponsive. Viewing the sprint backlog is painful in a different way. The items would appear line-by-line as each agonising second ticked by. Then if I scrolled up or down, more of the same.

SO Question
But before Visual Studio crashed for good, strange clues appeared. For example, in my frustration and impatience I sometimes idly clicked some of these merge windows and dragged them, and noticed that the dialog would go away, resolved. Hmmmm. Also, as VS thrashed about in its death throes, the desktop icons would disappear and reappear, and disappear, and reappear...

So, did it have something to do with graphics? And therefore not network latency as I'd assumed? And what was this I heard about WPF? I never thought of VS as being something that might need the assistance of a graphics card, but it seems it does. I noticed, in contrast to my colleagues, I had no dedicated graphics card. And that was the difference. I was in screen redraw hell.

Acknowledgement: I must at this juncture point out that it was a colleague, the man I call 'Andrew of a Few Desks Away', that helped me realise all this and who showed me how to fix it. I owe him a doughnut and a follow on the social media platform of his choice.

The bottom line

Tools -> Options -> Environment, General. Check 'Use hardware graphics acceleration if possible'.