问题
I have been using the ASP.NET chart controls for a while on win2k3 (32bit) setups without any issue but have noticed that on our new win2k8 (64bit) box I am getting a warning message showing up in the event viewer from the chart control.
In my web.config file I have the following tag telling the Chart Control where I can store the Temp Files:
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
Below is the warning message produced by the control:
Event code: 3005 Event message: An unhandled exception has occurred. Event time: 10/7/2009 2:40:03 PM Event time (UTC): 10/7/2009 2:40:03 PM Event ID: 237c3b208962429e8bbc5a48ffd177f0 Event sequence: 2860 Event occurrence: 26 Event detail code: 0
Application information: Application domain: /LM/W3SVC/2/ROOT-1-128993655360497729 Trust level: Full Application Virtual Path: / Application Path: C:\data\sites\mydomain.com\ Machine name: 231692-WEB
Process information: Process ID: 4068 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE
Exception information: Exception type: ArgumentException Exception message: The image is not found.
Request information:
Request URL: http://www.mydomain.com/ChartImg.axd?i=chart_0_3.png&g=bccc8aa11abb470980c60e8cf1e71e15
Request path: /ChartImg.axd
User host address: my domain ip
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information: Thread ID: 7 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.ProcessSavedChartImage(HttpContext context) at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
It's worth pointing out that ALL of the chart images are displayed correctly on the screen so I'm not sure when/where the image not found error is being caused. Is this a 64bit issue?
Thanks, Rich
回答1:
I had the same error occur whenever users tried to copy or drag a chart from IE to a Word document. By default the server deletes chart images immediately after they've been delivered to the user's browser, and IE doesn't seem to copy the cached image data. I'm not sure of the mechanics behind it, but on either the copy or the paste, the image has to be fetched from the server again. The problem was resolved by changing the entry in web.config to:
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;deleteAfterServicing=false;" />
回答2:
Are you running this in a native IIS7 site, or an IIS7 site running in ASP.NET 2.0 compatibility mode?
It's possible that IIS is just being a bit verbose with it's logging, or logging that there's an issue, and then falling back to a legacy support type mode - the .axd files are virtual files that don't usually exist on the disk, they are mapped in as handlers in your web.config - note that IIS7 now supports the <system.webServer>
element, and your handlers should be mapped in there for new sites, rather than in the <system.web>
section.
回答3:
I spent the week looking into this issue and no one seems to have an answer as to why I am getting the warning messages in Event Viewer.
Have asked this question on the main MS Chart forums too but no luck. link here: http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/75f50254-0f02-4a73-bfbe-afab31f15f77
Will mark as answered just to close question but will update in the future if I ever find an answer. I suspect it is happening to more people but because everything on the front end looks ok no one ever really checks the logs so they might not realize it's happening to them.
回答4:
In my experience you will receive this error message if the user tries to print the web page if deleteAfterServicing is not false in the web.config , because the image will have been deleted.
Also, if deleteAfterServicing=false, if user1 generates a chart, then user2 generates a chart overwriting the chart image, user2 can successfully print the chart, but user1 will trigger the exception.
来源:https://stackoverflow.com/questions/1531825/asp-net-chart-control-errors-in-event-viewer