For those who like me didn’t know about this hidden gem:
You can now set Tracepoints instead of just Breakpoints in VS2008. Here’s the difference between the two as described on MSDN:
“Breakpoints tell the debugger that an application should break, pause execution, at a certain point. When a break occurs, your program and the debugger are said to be in break mode. For more information, see Breaking Execution.
Tracepoints are a new debugger feature in Visual Studio. A tracepoint is a breakpoint with a custom action associated with it. When a tracepoint is hit, the debugger performs the specified tracepoint action instead of, or in addition to, breaking program execution.”
To set a Tracepoint, right-click on the line of code you want to debug, go to Breakpoint > Insert Tracepoint. In the breakpoint dialog below, you will be able to specify a message to print each time the tracepoint is hit. This is a handy way of having debug trace to output variable values without littering your code with “Debug.WriteLine” all over.
Cheers
Pascal
