使用图表 在面临此错误 asp.net "The process cannot access the file.... "



我使用asp.net中的图表控件创建了一个网站。当负载用户越来越大时,日志中会出现错误。错误细节如下所示如何解决此问题。

异常详细信息:引发了类型为"System.Web.HttpException"的异常。位于System.Web.UI.Page.AncPageEndProcessRequest(IAsyncResult结果)位于c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30119\临时中的ASP.city_aspx.EndProcessRequest(IAsyncResult ar)

ASP.NET Files\root\f4f3c9d4\d7501188\App_Web_3mnuhygo.2.cs:line 0位于System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerComplete(IAsyncResult ar)System.Web.HttpUnhandledException(0x80004005):引发了"System.Web.HttpUnhandledException"类型的异常。--->

System.IO.IOException:进程无法访问文件"D:\MeeToo\Deploy\Website\tempimg\60101037.png",因为它是

被另一个过程使用。在System.IO.__Error.WinIOError(Int32错误代码,字符串可能为FullPath)在System.IO.FileStream.Init(字符串路径、FileMode模式、FileAccess访问、Int32权限、布尔使用权限、FileShare共享、Int32

bufferSize、FileOptions选项、SECURITY_ATTRIBUTES secAttrs、字符串消息路径、布尔值bFromProxy、布尔值useLongPath)在System.IO.FileStream.ctor(字符串路径、FileMode模式、FileAccess访问、FileShare共享、Int32缓冲区大小、FileOptions选项、

字符串msgPath,布尔值bFromProxy)在System.IO.FileStream.ctor(字符串路径,FileMode模式)位于System.Web.UI.DataVisualization.Charting.SaveImage(String-imageFileName)位于System.Web.UI.DataVisualization.Charting.Render(HtmlTextWriter编写器)位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子级)位于System.Web.UI.HtmlControls.HtmlContainerControl.RRender(HtmlTextWriter编写器)位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子级)位于System.Web.UI.HtmlControls.HtmlContainerControl.RRender(HtmlTextWriter编写器)在d:\MeeToo\Deploy中的ASP.control_locationinfo_ascx._Render_control1(HtmlTextWriter __w,control parameterContainer)

\Website\control\LocationInfo.ascx:第14行位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子级)位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子级)位于System.Web.UI.HtmlControls.HtmlContainerControl.RRender(HtmlTextWriter编写器)位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子级)位于System.Web.UI.Page.RRender(HtmlTextWriter编写器)在System.Web.UI.Page.ProcessRequestMain上(布尔值包含同步点之前的阶段,布尔值包括同步点之后的阶段)位于System.Web.UI.Page.HandleError(异常e)在System.Web.UI.Page.ProcessRequestMain上(布尔值包含同步点之前的阶段,布尔值包括同步点之后的阶段)在System.Web.UI.Page.ProcessRequest(布尔值包含同步点之前的阶段,布尔值包括同步点之后的阶段)在System.Web.UI.Page.PageAsyncInfo.CallHandlersPossiblyUnderLock(页面线程上的布尔值)

System.IO.IOException: The process cannot access the file   
'D:MeeTooDeployWebsitetempimg60101037.png' 
because it is being used by another process.

上面的消息告诉你是什么原因造成的。it is being used by another process.您需要确保没有其他进程访问此文件(60101037.png)

这似乎也发生在其他一些人身上。他们通过添加为文件提供唯一名称并清除旧文件的代码来解决这个问题,因为新文件当然不会被锁定。

<asp:Chart ImageType="Png" runat="server" ID="chartStatComp" Palette="BrightPastel"
ImageLocation="~/CRM/Reports/chartStatComp_#SEQ(100,10)" ImageStorageMode="UseImageLocation"
Width="620" Height="300">

进程无法访问System.Web.UI.DataVisualization.Charting 的文件错误

相关内容

最新更新