C#; implementing an inherited abstract member
Posted on 2004-08-03
I am working through Amit Kalani's book in preperation for Microsoft exam 70-315 (Web Apps in C# and .NET), currently nearing the end, the chapter pertaining to testing, debugging and deployment.
The current exercise is about trace listeners, and has you develop a custom class called EmailTraceListener that sends any debug or trace info to an email address. It inherits from the TraceListener class. According to the book, in order to inherit from this class, you must at least implement its Write() and WriteLine() methods, which I have done. Then you also create a Web form pertaining to calculating factorials. In the code for the form, you add a custom listener to the PageLoad() method which uses an EmailTraceListener to add to the custom Listeners collection.
When I attempt to run the Web page, I get an error message in my output window stating that the page does not implement inherited abstract member "System.Diagnostics.TraceListener.Write(string)".
Here is a copy directly from the custom class:
public override void Write(string message)
if (this.message == null)
this.message = new StringBuilder();
Any input out there that might solve this issue?
Thanks in advance,