Login | Register    RSS Feed Download our iPhone app Browse DevX
Sign up for e-mail newsletters from DevX   Exploring Secrets of
.NET Diagnostics : Page 3   Connecting Diagnostics Between Your
Application and External Libraries The SomeCalc method called
inside ProcessLevel2 is a static method defined in the
SomeLibClass shown next. (Whether it is a static or an instance
method is unimportant.) This small class is contained in a
separate library defined in a separate Visual Studio project
called TraceSourceDemoLibrary, which generates a DLL referenced
in the current project. (The TraceSourceDemoLibrary could just
as easily have been in a separate solution.) The point is that
the coupling between the current project and the library is
minimal. Here is the entire class:  public class SomeLibClass {
private static StructuredTraceSource tracer = new
StructuredTraceSource("DemoSecond"); public static void
SomeCalc() { tracer.TraceEnter(); tracer.TraceInformation("stuff
in a library module"); tracer.TraceLeave(); }