I am getting this error
Invalid temp directory in chart handler configuration [c:\\TempImageFiles\\].
While running my code.
Intially I was getting
You need to use a temporary directory that is within the folder hierarchy of your web application. In Windows Azure, you don't have access to c:\TempImages, so that is not going to work.
I created a quick sample of ASP.Net Charts working in Windows Azure here: http://code.msdn.microsoft.com/azurecharts
You can still use file storage for the temporary images:
If you don't want to download the sample, here are the steps to get it working:
TempImages
, for example).temp.txt
, or whatever) to this folder. The dev tools don't seem to publish empty directories.Set the image location of your chart to:
ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)"
Add the following to appSettings in your web.config :
<add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=~/tempImages/;"/>
Make sure the following is in system.web/assemblies :
<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Make sure the following is in system.web/httpHandlers :
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
Make sure the following is in system.webServer/handlers
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
The code I uploaded to code.msdn.com should suffice as an example.
Just create a folder with name 'TempImageFiles' in C drive.
I had the same issue, my problem was my provider had special folders with write rights, so I changed the TempImagesFile folder to their default folder and it worked.
In my case the folder with write rights was called upload
web.config edits:
<appSettings>
<add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=~/upload/;"/>
</appSettings>
Hope this can help other too ;)
try to add this key to your web.config
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
instead of the default one:
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
Check out this answer on the Windows Azure forum: http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/92238582-9445-4d15-a5a7-5f24fd4bf646/.
Update your app setting to this and see if that fixes your problem
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;deleteAfterServicing=false;privateImages=false" />
<add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"/>
</appSettings>