Pierre Greborio.NET

Talking about .NET world

Tracing in ASP.NET : solved !

During these "vacation" days I studied the Tracing capabilities for a web application (both in ASP.NET 1.1 and 1.2). The solution is pretty simple, ASP.NET doesn't works on System.Diagnostics.Trace class but on System.Web.TraceContext. Then, if you need to trace something with ASP.NET (Web Services too) you have to use TraceContext's methods (Write and Warn).

In order to write ASP.NET trace messages to some trace listener you have to set writeToDiagnosticsTrace to true (<trace enabled="true" writeToDiagnosticsTrace="true"/>). In this way, all messages (using both Trace or TraceContext) will write to the listeners defined.

Comments

Matt Hawley said:

Ahh yes, I think I saw that...thought to myself for a second then discarded my thought (maybe GC.Collect was called on my brain at that point?).
# December 30, 2004 11:05 AM

Pierre Greborio said:

I have the same problem with my buggy GC :-)
# December 30, 2004 11:30 AM