0
我正在使用.net tracelistener来启用应用程序中的日志记录功能。我的应用程序是多线程.Net服务。在重负载下,.Net跟踪会抛出以下错误。 有没有人有任何想法,为什么这是幸福和任何解决方案呢?.net tracelistener问题
System.UnhandledExceptionEventArgs
System.IO.IOException
mscorlib
The process cannot access the file 'C:\035_Prg.log' because it is being used by another process.
Server stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.Diagnostics.TraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id)
at System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceSource.TraceInformation(String message)
您是否尝试停止您的服务或IIS托管您的服务,或在任务管理器中终止asp_net进程? – Kuncevic 2011-02-01 11:15:38