Groups | Blog | Home
all groups > visual studio .net debugging > september 2005 >

visual studio .net debugging : My own Tracelistener options thru app.config?


Bram Hoefnagel
9/16/2005 3:06:44 AM
Hello,
Does somebody maybe knows of it is possible to add my own tracelistener
to the traceSource using the config file? I'm using vs2005 b2, and
wrote a tracelistener that i want to use as a 'normal' tracelistener in
the config file (Adding the listener to the tracesource with
programcode works fine). For example:

<system.diagnostics>
<sources>
<source name="mySource" switchValue="All">
<listeners>
<add name="file" type="MyDiagnostics.MyFileTraceListener"/>
<remove name="Default"/>
</listeners>
</source>
</sources>
</system.diagnostics>

When i use above code, i'm getting a
System.Configuration.ConfigurationException that says: Couldn't find
type for class Mydiagnostics.MyFileTraceListener.

Does someone also now how to implement the custom properties of
MyFileTraceListener by using the app.config, like:
<add name="file" type="MyDiagnostics.MyFileTraceListener"
traceLongExceptions="true"/>

thanx in advance!

Bram Hoefnagel
Bram Hoefnagel
10/7/2005 2:42:50 AM
Mike Rousos from the Microsoft BCL Team, has responded on my question.
So for your info:

Thanks for the feedback! I actually cover both of those question in the
second part of my tracing primer, which I've written and just
haven't found the time to proofread and post yet. Anyhow, I'll
attach the blog here so that you can take a look at it and get answers
to your questions. I'll see if I can get it proofread, split into
three more modestly sized entries, and posted on the web later today.

You'll find his post on:
http://blogs.msdn.com/bclteam/archive/2005/09/21/472021.aspx
AddThis Social Bookmark Button