James Steele

All things dotNet running through my veins

System.Diagnostics.EventLogTraceListener Not Inerhitable! Why?

I was starting to design a listener framework for an ASP.NET application.  I had a look at the three out of the box listener implementations provided by the .NET Framework.

EventLogTraceListener
TextWriterTraceListener
DefaultTraceListener

I decided I wanted to extend the EventLogTraceListener interface and add a few of my own interface methods and properties. At that point I made the decision I was going to use this class as a base class and derive my own sub class from it. To my surprise the EventLogTraceListener is marked as Not Inherhitable!

The TextWriterTraceListener and DefaultTraceListener are Inheritable? What gives with the EventLogTraceListener? Why can it not be used as a base class?

Comments

Drew Marsh said:

Why not create a custom TraceListener that contains an EventLogTraceListener and delegates to it after you've done whatever specific pre-processing work you need to do?
# March 18, 2004 11:38 AM

James Steele said:

Yes Drew, that is one of the options I am considering.
# March 18, 2004 1:33 PM

joomla extension said:

I’ve been reading your blog all along, I simply don’t have the words. I just wanted you to know that I’m fond of your blog so much.

# November 17, 2011 5:33 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)