DEV Community

Jeremy Hutchinson
Jeremy Hutchinson

Posted on • Originally published at hutchcodes.net on

4 2

Visual Studio Tips - Trace Points

Tracepoints are not a new feature, they’ve been in Visual Studio since 2005, but they are a new feature to me. I just stumbled on them while researching for this series of posts. Tracepoints allow you to turn a Breakpoint into what is essentially a call to Debug.WriteLine().

A Tracepoint is just a special kind of Breakpoint that allows you to log a message to the Output window and continue execution. This can be really helpful in situations where stopping at a breakpoint makes reproducing a bug difficult or impossible.

And since Tracepoints are just a kind of Breakpoint, you can also put conditions on them and manage them just like Breakpoints. To learn more about Breakpoints see this post.

To set a Tracepoint, you set a normal breakpoint, then go into the settings of that Breakpoint and check Actions. That will display a textbox for you to create your log message and another checkbox to specify whether execution should stop or continue.

alt text

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay