0

I have a question:

I'm working on a project in C # that creates log files in my local computer creates the necessary files and writes perfectly.

Trace.Listeners.Add(new TextWriterTraceListener("mylog.log"), "myListener"));
Trace.TraceInformation( "test message");
Trace.Flush();

But in my server also creates other files with unknown names like this:

62735167-1d87-4521-a1f2-40504fb51b59mylog.log

and contains the following lines I write. I can not delete that file. Any solution for this problem?

thanks

  • You probably can't delete that file because some process has a lock on it. Run Process Explorer to see which process has a file handle for the file. That would be the first step to figuring out what's going on. – Mike Van Vertloo Oct 18 '13 at 17:53
  • my problem is: why write the line in another file? – user2895788 Oct 18 '13 at 19:49
  • You probably have a default trace listener. The log file name itself looks like it might have been derived from a call to AppDomain.CurrentDomain.FriendlyName. – 500 - Internal Server Error Oct 18 '13 at 20:24

0 Answers0