0

I make a website using the chart control in asp.net. When the load users become bigger and bigger, the Error occurs in the log. The error detail is like this how solve this.

Exception Details: Exception of type 'System.Web.HttpException' was thrown. at System.Web.UI.Page.AsyncPageEndProcessRequest(IAsyncResult result) at ASP.city_aspx.EndProcessRequest(IAsyncResult ar) in c:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Temporary

ASP.NET Files\root\f4f3c9d4\d7501188\App_Web_3mnuhygo.2.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. --->

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

used by another process. at 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 options, 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) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at 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:line 14 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.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(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.PageAsyncInfo.CallHandlersPossiblyUnderLock(Boolean onPageThread)

Christopher Bai
  • 391
  • 1
  • 5
  • 11

2 Answers2

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.

the above message tell you what has caused.it is being used by another process. you need sure not another process access this file(60101037.png)

zhengchun
  • 1,261
  • 13
  • 19
0

It seems like this has happened to a few other people as well. They fixed it by adding code that gives unique names to files and cleans old ones, since new files are of course never locked.

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

The process cannot access the file error with System.Web.UI.DataVisualization.Charting

Community
  • 1
  • 1
msigman
  • 4,474
  • 2
  • 20
  • 32