Server Error in '/' Application.

The process cannot access the file 'E:\mispueblos.es\logs\mp240328.log' because it is being used by another process.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.IOException: The process cannot access the file 'E:\mispueblos.es\logs\mp240328.log' because it is being used by another process.

Source Error:


Line 191:    
Line 192:    // Abrimos o creamos el fichero de log
Line 193:    StreamWriter swLog = new StreamWriter(sFileName, true, Encoding.UTF8);
Line 194:
Line 195:    // Ponemos la cabecera si es necesario

Source File: e:\mispueblos.es\App_Code\comun.cs    Line: 193

Stack Trace:


[IOException: The process cannot access the file 'E:\mispueblos.es\logs\mp240328.log' because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7724048
   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) +1162
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +65
   System.IO.StreamWriter.CreateFile(String path, Boolean append) +62
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) +58
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) +29
   comun.WriteToLog(Exception Ex, HttpRequest Re) in e:\mispueblos.es\App_Code\comun.cs:193
   _Default.Page_Load(Object sender, EventArgs e) in e:\mispueblos.es\poblacion.aspx.cs:1014
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3662; ASP.NET Version:2.0.50727.3668