Trace vs Debug in .NET BCL

The main difference is the one you indicate: Debug is not included in release, while Trace is.

The intended difference, as I understand it, is that development teams might use Debug to emit rich, descriptive messages that might prove too detailed (or revealing) for the consumer(s) of a product, while Trace is intended to emit the kinds of messages that are more specifically geared toward instrumenting an application.

To answer your last question, I can’t think of a reason to use Debug to instrument a piece of code I intended to release.

Hope this helps.

Leave a Comment