PC Review


Reply
Thread Tools Rate Thread

Can't enable tracing via app.config

 
 
Brad Wood
Guest
Posts: n/a
 
      4th Nov 2005
I've used tracing before, but today I've tried everything and can't get
a simple sample working.

This is my app config (I've also tried specifying a fully qualified type
name for the type attribute of the add element):
<configuration>
<system.diagnostics>
<trace autoflush="false">
<listeners>
<add name="bob"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="E:\log.txt" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

I've added the #define DEBUG directive to the only code file in my
project. When I run the app and examine the Listeners collection, there
is only the one DefaultTraceListener, no TextWriterTraceListener.

I can't figure out why...
 
Reply With Quote
 
 
 
 
Brad Wood
Guest
Posts: n/a
 
      4th Nov 2005
Finally discovered what I was doing. I added an additional config file
to my (existing) test project so the new config file wasn't being used
at all.
Also, I didn't need the #define DEBUG or #define TRACE directive even
though the documentation says one or the other is required.

Brad Wood wrote:
> I've used tracing before, but today I've tried everything and can't get
> a simple sample working.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you enable wcf tracing without a config file (programmatica Jason Rodman Microsoft Dot NET Framework 0 29th Dec 2007 10:00 PM
tracing from config file??? =?Utf-8?B?Y2FsZGVyYXJh?= Microsoft Dot NET 0 25th Jul 2007 10:28 AM
Tracing with web.config Mitkip Microsoft Dot NET Framework 4 24th Apr 2006 04:33 PM
Tracing and Web.Config =?Utf-8?B?U2hhd24gTWVsdG9u?= Microsoft ASP .NET 3 18th Apr 2005 11:51 PM
Enable Tracing with Wireless Mike Windows XP Networking 0 11th Oct 2004 01:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:24 AM.