1
설명서 읽기이 코드는 스레드 세이프 방식으로 파일에 로그를 쓸 것이라고 생각했습니다.로그 파일에 쓰는 중 TextWriter.Synchronized를 사용하여 스레드 안전
using (TextWriter syncTextWriter = TextWriter.Synchronized(new StreamWriter(Server.MapPath(String.Format("~/App_Data/PaypalIPN/IPNlog_{0:yyyyMM}.txt", DateTime.Now)), true)))
{
syncTextWriter.WriteLine(line);
syncTextWriter.Close();
}
나는 트래픽이 높은 사이트를 가지고 있지 않지만, 모든 이제 다시 두 사람이 동시에 페이팔 지불을, 이것은 IPN 지급 로그입니다. TextWriter.Synchronized
을 도입에도 불구하고 나는 여전히 이상한 예외를 얻고있다 :
System.IO.IOException: The process cannot access the file ...
...because it is being used by another process.
내가 잘못 갈
?