Tuesday, 24 January 2012

VS2010 project runs slow when attached to debugger

I had an interesting problem occur to me today. I was using a new installation of Visual Studio 2010 Ultimate onto a machine other than my usual development machine. I needed to do some performance analysis on a machine that was nearer to a deployment configuration.
After copying the code project over and running the project as normal inside the debugger, I found it to be extremely slow. General interaction was a bit sluggish, but the chunks of code that did some serious work were crawling. Running the program outside the debugger (CTRL+F5 instead of F5) found the application to run at normal speed.
After a couple of reboots and head scratching, upon investigation I found that people were suggesting to delete any breakpoints, so I went to the debug menu to delete all, but it was greyed out (I assume because no breakpoints were present).
So I added a breakpoint on a line of code and then went to the menu option and removed all breakpoints. Strangely after this the code started working at full speed.

Thursday, 19 January 2012

Digital SLR Cheat Sheet

Here's a handy cheat sheet that helps quickly remind you of what all those fiddly settings on your shiny new SLR do.

Thursday, 12 January 2012

VS2010 Keyboard and Mouse Shortcuts

Keyboard and mouse shortcuts are critical to fast coding in VS2010:

Useful frequently used shortcuts for me are:
Ctrl+K -> Ctrl+C = Comment code
Ctrl+K -> Ctrl+U = Uncomment code
Shift+F12 = Find usages
Ctrl+] = Find matching brace/bracket
F9 - Add/remove breakpoint
F12 - Go to definition
Ctrl+K -> Ctrl+S = Surround code with... choose snippet.