G
Guest
I cannot get a clean compile if I add Trace configuration info into my
web.config. This generates an error:
<configuration>
<system.diagnostics>
<switches>
<add name="MyTraceSwitch" value="4" />
</switches>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="TextListener"
type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\my.log"
/>
<remove type="System.Diagnostics.DefaultTraceListener" />
</listeners>
</trace>
</system.diagnostics>
<configuration>
If i remove the Trace section but leave in the TraceSwitch part like:
<configuration>
<system.diagnostics>
<switches>
<add name="MyTraceSwitch" value="4" />
</switches>
</system.diagnostics>
<configuration>
the app compiles but when I use the code:
TraceSwitch MyTraceSwitch = new TraceSwitch("MyTraceSwitch","My Web Service");
then check the value of MyTraceSwitch.TraceLevel it's off like the
web.config was ignored.
Any suggestions on how to correct this?
web.config. This generates an error:
<configuration>
<system.diagnostics>
<switches>
<add name="MyTraceSwitch" value="4" />
</switches>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="TextListener"
type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\my.log"
/>
<remove type="System.Diagnostics.DefaultTraceListener" />
</listeners>
</trace>
</system.diagnostics>
<configuration>
If i remove the Trace section but leave in the TraceSwitch part like:
<configuration>
<system.diagnostics>
<switches>
<add name="MyTraceSwitch" value="4" />
</switches>
</system.diagnostics>
<configuration>
the app compiles but when I use the code:
TraceSwitch MyTraceSwitch = new TraceSwitch("MyTraceSwitch","My Web Service");
then check the value of MyTraceSwitch.TraceLevel it's off like the
web.config was ignored.
Any suggestions on how to correct this?