3

I am getting this error:

Invalid temp directory in chart handler configuration [C:\Users\user1\Documents\Visual Studio 2010\WebSites\Website1].

Intially I was getting No http handler was found for request type ‘GET’ error which I solved.

But now I am getting the above error.

Here is my web.config,

    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
<configuration>

  <appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;" />
  </appSettings>

  <system.webServer>
    <handlers>
      <add name="ChartImg" verb="*" path="ChartImg.axd"  type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  />
    </handlers>
  </system.webServer>

  <system.web>

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>

    <authentication mode="None" />

    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</configuration>

Let me know what I am doing wrong.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Arpita
  • 445
  • 3
  • 14
  • 28

2 Answers2

2

I had the same problem and i tried everything , but nothing worked. Till i found out that you can also use the memory for it

So you need to change:

<appSettings>
<add key="ChartImageHandler" value="Storage=file;Timeout=20;"/>
</appSettings>

to

<appSettings>
<add key="ChartImageHandler" value="Storage=memory;Timeout=20;"/>
</appSettings>

Then it will store the image in the memory.

Creator
  • 1,502
  • 4
  • 17
  • 30
0

Problem is the temporary directory. It could be because:

  • The directory no exists,
  • The user has no permission to the directory,
  • You are pointing to the wrong directory, or
  • when you move your programs form a local PC to a server you are no longer pointing to a local file, you are pointing to a URL

Solutions:

  • If you are using a web server, the easy and lazy solution is create a directory named temp where the aspx is located. In the same directory and give the users permission to modify.

  • If you are using a local PC you can use memory instead of file. No use this in the web server because is to heave for many users, but use:

    <add key="ChartImageHandler" value="Storage=memory;Timeout=20;"/>
    
  • If you are using a web server, the best option is use a url instead of a file like this:

    <add key="ChartImageHandler" value="storage=file;timeout=20;url=~/temp" />
    

    You can use ~ / . or http://…

To Add permission to the ISS user, could be your user pool, windows user or any user as you used before. If you use Windows authentication, then you should grant permission to the user named “Domain Users”. Some people add permission to the user everybody. This permission should include “Modify”