Exception in configuration section handler (Trace)

P

Prince

Hai all,

I got this exception in my application and that occurs in the
follwing line..

Trace.WriteLine("Text");

{@"Exception in configuration section handler (D:\Program
\stringoperation\bin\Debug\stringoperation.exe.config line 12)" }

I defined the trace in app.config as follows

<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="d:\\Program\\stringoperation\\doc\\stringoperation.txt"
/>
<remove type="System.Diagnostics.DefaultTraceListener"/>
</listeners>
</trace>
</system.diagnostics>


Looking forward for ur reply...
Thanx in advance...
 
C

Christof Nordiek

Prince said:
Hai all,

I got this exception in my application and that occurs in the
follwing line..

Trace.WriteLine("Text");

{@"Exception in configuration section handler (D:\Program
\stringoperation\bin\Debug\stringoperation.exe.config line 12)" }

I defined the trace in app.config as follows

<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="d:\\Program\\stringoperation\\doc\\stringoperation.txt"
/>
<remove type="System.Diagnostics.DefaultTraceListener"/>
</listeners>
</trace>
</system.diagnostics>


Looking forward for ur reply...
Thanx in advance...
the app.config file is not a C#-programmfile, so you shouldn't use
escape-sequences like in C#.

try:
initiliazeData="d:\Programm\stringoperation\doc\stringoperation.txt"

hth
 
P

Prince

Hi...

As u told I used single Backslash(\) but still it is showing the
exception...

Looking forward for ur reply...
 
O

Ollie Riches

I ran your code snippet and it worked fine the only reason I can see it will
fail is if the directory does not exist.

HTH

Ollie Riches
 
P

Prince

hi Riches,

I made the destination folder as very simple as follows

initializeData = "c:\text.txt"
but still i am getting the exception...

Looking forward for ur reply...
 

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