我正在使用高图,只有当我在Intranet网络中的IIS服务器上运行我的网站时才会收到此错误。相反,它在开发服务器(visual studio 2012)
中工作正常图表处理程序配置中的临时图像目录无效 [C:\ TempImageFiles]。请编辑web.config文件。该 CharImageHandler键,Dir值必须指向有效目录。该 存储模式时临时映像存储需要目录 等于文件系统。
堆栈跟踪
[DirectoryNotFoundException: Invalid temp images directory in chart handler configuration [c:\TempImageFiles\]. Please edit the web.config file. The CharImageHandler key, Dir value must point to a valid directory. The directory is required for temporary image storage when storage mode equals file system.]
System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() +1426397
System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(String parameters) +1352
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() +197
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() +51
System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) +357
System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() +50
System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +395
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +49
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +249
System.Web.UI.Page.Render(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5363
答案 0 :(得分:19)
以前在web.config
<add key="ChartImageHandler" value="storage=file;timeout=20; dir=c:\TempImageFiles/;" />
我删除了目录位置
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
问题解决了。
答案 1 :(得分:4)
检查服务器上是否存在该文件夹,并为您的网站为该文件夹运行的应用程序池的用户授予读/写权限。
或者您可以简单地将该临时文件夹移动到站点根目录Es:&#34;〜/ temp&#34;并配置highchart以使用该文件夹。
或者您可以从
更改ChartImageHandler<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
要
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
所以他将使用默认的Windows临时目录