Did you know… You can use Tracepoints to log “printf” or “console.writeline” info without editing your code? - #237
his was tip #15 in my TechEd 2008 VS IDE Tips and Tricks talk.
This is a new feature for VS2008.
On a given line of code where you want to log the value of a variable, you could do the old fashion way of doing a Console.Writeline() or a PrintF(). But in VS 2008, there’s a new feature called tracepoints.
Just right-click, select breakpoints, but instead of Insert Breakpoint, select Insert Tracepoint.
This will bring up the Tracepoint dialog, where VS gives you some helpful defaults. But for this example, the really helpful default is in the descriptive text for logging the contents of a variable.
You’ll notice that the editor shows a diamond instead of a circle.
And the tracepoints are logged in the Output Window’s Debug Pane
Technorati Tags: VS2008Tip