Reputation: 1313
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.
Upvotes: 0
Views: 396