0

I am using asp.net ChartImageHandler to generate charts in my .aspx pages, Everything was working great until we tested application on a web farm environment.

The problem is that for some requests, Chart returns 404 error and cannot find the image, This is the config that we use:

  <appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;deleteAfterServicing=false;" />
  </appSettings>

I guess that it is because the chart is stored in one server and not stored in the other server. I have this section in my web.config file:

<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3986ad364e35" />

ChartImageHandler is present in the handler mapping of site created in IIS.

As said in documentation page in here, What I understand is that for web farm environment, we should set the storage to file and the other two options are not applicable to web farm environment.

the dir path should be a network path and I tried this network path but it didn't work either ! here what the config look like with the network directory:

And also the network address \\serverIp\TempImageFiles is accessible from windows explorer.

Any suggestion for making this work is much appreciated !

Edit: We changed the affinity of load balancer and everything worked fine.

Rathma
  • 1,196
  • 2
  • 33
  • 65
  • Ensure that your application pool identity user has read and write permissions on the network path set at `dir` – Mohsin Mehmood Dec 25 '18 at 19:22
  • we have added Network Service the full permission to the folder. – Rathma Dec 25 '18 at 20:47
  • You confirmed that application pool identity is set to `Network Service`? Also, is it intermittent issue? Confirm that image files are generated in shared directory – Mohsin Mehmood Dec 25 '18 at 20:49
  • Every thing is set to default, I really don't know about pool identity, yes it is intermittent issue, when I set the `dir` directory application crashes. – Rathma Dec 26 '18 at 06:35

0 Answers0