views:

283

answers:

1

Hi,

Anyone knows the difference between System.Diagnostic.Trace and System.Diagnostic.TraceSource?

I've been using Trace for most of my projects and I just happen to found out about TraceSource the other day. They seems to offer similar API, is one better than the other?

+1  A: 

I think TraceSource is the newer version (since .NET 2) and Trace is the older version, more info is available here:

Clarification on TraceSource/Trace

Steve Temple
From http://msdn.microsoft.com/en-us/library/ms228989.aspx: "TraceSource is intended to function as an enhanced tracing system and can be used in place of the static methods of the older Trace and Debug tracing classes. The familiar Trace and Debug classes still exist, but the recommended practice is to use the TraceSource class for tracing."
emddudley