Exception in configuration section handler (Trace)

  • Thread starter Thread starter Prince
  • Start date Start date
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...
 
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
 
Hi...

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

Looking forward for ur reply...
 
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
 
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...
 
Back
Top