asp.net:Invalid temp directory in chart handler configuration [c:\TempImageFiles\]

前端 未结 10 1225
北荒
北荒 2020-12-13 02:31

I am getting this error Invalid temp directory in chart handler configuration [c:\\TempImageFiles\\]. While running my code.

Intially I was getting

10条回答
  •  被撕碎了的回忆
    2020-12-13 03:03

    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:

    1. In your Solution, create a folder (called TempImages, for example).
    2. Add a file (temp.txt, or whatever) to this folder. The dev tools don't seem to publish empty directories.
    3. Set the image location of your chart to:

      ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)"

    4. Add the following to appSettings in your web.config :

    5. Make sure the following is in system.web/assemblies :

    6. Make sure the following is in system.web/httpHandlers :

    7. Make sure the following is in system.webServer/handlers

    The code I uploaded to code.msdn.com should suffice as an example.

提交回复
热议问题