0

我使用asp.net中的图表控件制作了一个网站。当负载用户越来越大时,日志中会出现错误。错误细节是这样的,如何解决这个问题。

异常详细信息:引发了“System.Web.HttpException”类型的异常。在 System.Web.UI.Page.AsyncPageEndProcessRequest(IAsyncResult result) 在 ASP.city_aspx.EndProcessRequest(IAsyncResult ar) 在 c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Temporary

ASP.NET Files\root\f4f3c9d4\d7501188\App_Web_3mnuhygo.2.cs:System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) System.Web.HttpUnhandledException (0x80004005) 的第 0 行:“System.Web”类型的异常。抛出了 HttpUnhandledException'。--->

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

被另一个进程使用。在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32

bufferSize, FileOptions 选项, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options,

String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.UI.DataVisualization.Charting.Chart.SaveImage(String imageFileName) at System.Web.UI.DataVisualization.Charting .Chart.Render(HtmlTextWriter writer) 在 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 在 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) 在 System.Web.UI.Control。 RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at ASP.control_locationinfo_ascx._ Render _control1(HtmlTextWriter __w, Control parameterContainer) in d:\MeeToo\Deploy

\Website\control\LocationInfo.ascx:System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection children)处 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection children)的第 14 行。 UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Page .ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest (布尔包括StagesBeforeAsyncPoint,System.Web.UI.Page.PageAsyncInfo.CallHandlersPossiblyUnderLock 处的布尔 includeStagesAfterAsyncPoint)(布尔 onPageThread)

4

2 回答 2

0
System.IO.IOException: The process cannot access the file   
'D:\MeeToo\Deploy\Website\tempimg\60101037.png' 
because it is being used by another process.

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

于 2012-03-19T02:19:34.520 回答
0

似乎这也发生在其他一些人身上。他们通过添加为文件提供唯一名称并清理旧文件的代码来修复它,因为新文件当然永远不会被锁定。

<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 访问文件错误

于 2012-03-19T02:40:49.947 回答