Hi all.

I'm trying to write a TraceListener to log Debug.Write output into a database.

I've made a simple class as follows:

----- 8<-----
Public Class CustomListener

Inherits System.Diagnostics.TraceListener

Public Overloads Overrides Sub Write(ByVal Message As String)

'yadda

End Sub

Public Overloads Overrides Sub WriteLine(ByVal Message As String)

'yadda

End Sub

End Class
----- >8 -----

And I have added the following to my web.config file:

----- 8< -----
       <system.diagnostics>
               <trace autoflush="true" indentsize="0">
                       <listeners>
                               <add name="MyCustomListener"
type="System.Diagnostics.TraceListener,CustomListener" />
                       </listeners>
               </trace>
       </system.diagnostics>
----- >8 -----

However, I'm getting an error when I try to do a Debug.Write:

----- 8< -----
An exception of type
'System.Configuration.ConfigurationErrorsException' occurred in
System.dll but was not handled in user code

Additional information: Couldn't find type for class
System.Diagnostics.TraceListener,CustomListener.
----- >8 -----

Anyone got any ideas?  Bit stumped here.

Cheers,

Ben

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to