Hello, I am trying to learn a little bit about tracing. I am using this
example in a book which is written in C# and attempting to convert it to VB.
Here is the C# code.
public class AspNetTraceListener : TraceListener
{
public override void Write(string msg)
{
System.Web.HttpContent.Current.Trace.Write(msg);
}
public override void WriteLine(string msg)
{
System.Web.HttpContent.Current.Trace.Write(msg);
}
}
My VB code looks like the following:
Public Class AspNetTraceListener
Inherits TraceListener
Public Overrides Sub Write(ByVal msg As String)
System.Web.HttpContext.Current.Trace.Write(msg)
End Sub
Public Overrides Sub WriteLine(ByVal msg As String)
System.Web.HttpContext.Current.Trace.Write(msg)
End Sub
End Class
It highlights "Write" and "WriteLine" method names and tells me that the
method name shawdows an overloadable member in the base class - If you want to
overload the base method, this method must be declared as "overloads".
I don't believe that I want to overload the method, I believe I want to
override. When I make the change suggested, then my class name highlights as
well as each of my methods.
It looked so simple, but I guess I am out of my league here.
Any suggestions as to what is wrong?