Yellow sticky notes for your watched variables in the new VS 2010.

Published on Jul 22, 2009

One new feature in the code editor is the ability to put sticky notes in the code while debugging. This sticky notes are actually attached to a given variable and you can see the actual value of it in the note (similar to using the watch window).

To make use of this sticky notes you just need to hover your mouse over a variable while on a debugging session and in the hint for the value of the variable you will see a little note icon.


Click in the icon and a sticky note will be placed near the location of the cursor, you can move this note around in VS so it doesn?t interfere with the code.


Notice that the value is null since the variable have not been evaluated yet. You can click in the button of the note to add a comment.

If we continue running the program we can see that the value have been updated. This variable will hold an array of squares, so the value is the Length of the array. Click in the plus sign and you can see each value, now each value has an sticky note icon besides it as well, clicking them will add this variables into the same sticky note.



The notes disappear once the debug session ends, but starting a new session will bring up all the notes back.