Server Error in '/' Application.

The process cannot access the file 'C:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Data\errorlog.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 'C:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Data\errorlog.log' because it is being used by another process.

Source Error:


Line 1357:    {
Line 1358:        string fileName = HttpContext.Current.Server.MapPath("/App_Data/errorlog.log");
Line 1359:        using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Append, System.IO.FileAccess.Write))
Line 1360:        using (System.IO.StreamWriter sw = new System.IO.StreamWriter(fs))
Line 1361:        {

Source File: c:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Code\commands.cs    Line: 1359

Stack Trace:


[IOException: The process cannot access the file 'C:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Data\errorlog.log' 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) +125
   commands.logga_errori_db(String scrivi, Exception e) in c:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Code\commands.cs:1359
   commands.sql_get_value(String cmd) in c:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\App_Code\commands.cs:1442
   product.Page_Load(Object sender, EventArgs e) in c:\WEBFARM_MILITARIA\localuser\ftpinfabbrica\product.aspx.cs:300
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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