Sorry if I miss it somewhere, but I cannot find any documentation if a TraceListener
is automatically disposed by the framework.
If I use this code:
var traceListener = new DailyTraceListener("Logs", true);
Trace.Listeners.Add(traceListener);
Do I need to manually call traceListener.Dispose()
, assuming Dispose
should be called for it to work properly? Note that the implementation will throw error if Dispose
is called the 2nd time (I am trying to change it).
In this article:
The listeners are disposed by the TraceSource
What/Where is the TraceSource
in this case? Is it automatically disposed?
In short, is Dispose
guaranteed to be called by .NET when the program exits?