Using Visual Studio 2010’s Debugger PIN Feature

One of the very cool new features in Visual Studio 2010 is the ability to “Pin” a variable you are watching, right in the place you want to see it.  It’s always been a hassle to have to add a “Watch” and keep track of it among all your other watch variables.  I guess I shouldn’t really complain because I’ve always really like the debug capabilities in Visual Studio, but I have to say, this new “Pin” is really nice.

 

So, let me explain by example. 

At the moment, I’m debugging the Silicon Valley Code Camp web site project and I’m checking a boolean I set called DoValidation.  I’m trying to figure out why it is changing, but first I have to figure out when.  So, I set a break point on the line as shown below:

image

Now, I hover over the variable I want to pin and press the little pin icon shown here:

image

I then see the following with my little watch window right in line with my code.

image

I can even click the little chevron under the pin and add a comment as I show next.

image

The nice thing is that this stays here just like your break point until you close it.  A very convenient feature.

About Peter Kellner

Peter is a software professional specializing in mobile and web technologies. He has also been a Microsoft MVP for the past 7 years. To read more about Peter Kellner and his experience click here. For information about how Peter Kellner might be able to help you with your project click here.

Follow me:


Follow

Get every new post delivered to your Inbox

Join other followers: