how to save trace output into text file

I

IK

Hi all,

How can I save trace output to the text file in app's dir. In addition, I
need to save debug info from Session_End event in global.asax.
The code below saves file only in Windows\System32 dir.
TextWriterTraceListener tracer = new
TextWriterTraceListener("traceout.txt");
Trace.Listeners.Add(tracer);
Trace.WriteLine("Exception"+ex.Message);
tracer.Dispose();

When I try to open file in apps folder I get error message "access denied to
the file ..."

Thanks a lot,
IK
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top