The process cannot access the file 'C:\inetpub\wwwroot\data\textify\tempo.xml' because it is being used by another process.

Server Error in '/' Application.

The process cannot access the file 'C:\inetpub\wwwroot\data\textify\tempo.xml' 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 'C:\inetpub\wwwroot\data\textify\tempo.xml' because it is being used by another process.

Source Error:


Line 2557:                xml.AppendLine("</data>");
Line 2558:                string filePath = Server.MapPath("/data/textify/tempo.xml");
Line 2559:                using (StreamWriter swriter = new StreamWriter(filePath))
Line 2560:                {
Line 2561:                    swriter.Write(xml.ToString());

Source File: c:\inetpub\wwwroot\viewPathology.aspx    Line: 2559

Stack Trace:


[IOException: The process cannot access the file 'C:\inetpub\wwwroot\data\textify\tempo.xml' because it is being used by another process.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +935
   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, Boolean useLongPath, Boolean checkHost) +1242
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +146
   System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) +126
   System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) +105
   System.IO.StreamWriter..ctor(String path) +52
   ASP.viewpathology_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\viewPathology.aspx:2559
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4676.0