removing DefaultTraceListener in app.config

S

sam

Hi,
I am using the tracing features in system.Diagnostics
I want to be able to configure my listeners throught the app.config not in
code. I configured a TextWriterTraceListener which works fine. But I noticed
output was also being sent to the console, and if a Trace.Fail statement is
issued then a dialog box is raise to the user. I certainly dont want this to
happen so I am tring to removing the DefaultTraceListener, but it is not
working. He is what I have tried:

In app.config I entered this line in the <listeners> element:
<remove type="System.Diagnostics.DefaultTraceListener"/>
This made no difference.

So I changed it to:
<remove type="System.Diagnostics.DefaultTraceListener,System"/>
But I received the error message:
Couldn't find type for class System.Diagnostics.DefaultTraceListener,System

Next I read that I must supply a valid fully qualified assembly name, so I
executed the following code to received the fully qualified assembly
details:
Dim t As Type = GetType(System.Diagnostics.DefaultTraceListener)
Console.WriteLine(t.Assembly.FullName.ToString())
Using the information I added the following to my app.config:
<remove type="System.Diagnostics.DefaultTraceListener, 1.0.5000.0, neutral,
b77a5c561934e089"/>

But now I receive the following error message:
Couldn't find type for class System.Diagnostics.DefaultTraceListener,
1.0.5000.0, neutral, b77a5c561934e089.

What am I doing wrong here??

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top