I ran into this error today when attempting to show a web part on a SharePoint site that utilises the .NET 3.5 Chart Controls from MS (See link at the bottom of the post).
When the page opened it bombed out with the above error, some research found the following question on stackoverflow -
To fix this error you need to add the following entry into the <HttpHandlers> section of the web.config file:
[code lang="plain"]<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />[/code]
When I refreshed the page, I received another error – this time it was:
Invalid temp directory in chart handler configuration
If you too get this error then you need to make sure you have the following line in the <appSettings> section of the web.config:
[code lang="plain"]<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:TempImageFiles;" />[/code]
Also make sure that the above directory ‘TempImageFiles’ exists on the C: drive or you can change this to any other directory that you like.
Hope this helps!
Download link for MS Chart Controls: