asp中的错误:图表控件

发布于 2024-11-29 04:38:34 字数 4055 浏览 1 评论 0原文

我在我的网站中使用图表控件。代码和图表控件在我的本地计算机上完美运行。但是当我将它部署在网络服务器上时,它给出了错误。我还将网站的版本更改为 4.0,并在 web.config 中给出了所有选项卡和引用。

错误是

System.Web.HttpUnhandledException (0x80004005):抛出了“System.Web.HttpUnhandledException”类型的异常。 ---> System.IO.DirectoryNotFoundException:图表处理程序配置 [c:\TempImageFiles] 中的临时目录无效。在 System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() 在 System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(字符串参数) 在 System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeParameters()在 System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() 处System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() 在 System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean HardCheck) 在 System.Web.UI.DataVisualization.Charting.Chart.GetImageStorageMode() 在System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() 位于System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter 编写器) 在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter 编写器,ControlAdapter 适配器) 在 System.Web.UI.Control.RenderControl(HtmlTextWriter 编写器,ControlAdapter 适配器) )在 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) 在 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection 子项)在 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)在 System.Web.UI.Control.Render(HtmlTextWriter writer)在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter 适配器)在 System .Web.UI.Control.RenderControl(HtmlTextWriter writer,ControlAdapter 适配器)位于 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection 子级)在 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)在 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)在 System .Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter输出)位于System.Web.UI.Control.RenderControlInternal(HtmlTextWriter 编写器,ControlAdapter 适配器)位于 System.Web.UI.Control.RenderControl(HtmlTextWriter 编写器,ControlAdapter 适配器)位于 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter 编写器) System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter 编写器,ICollection 子级)位于System.Web.UI.Control.RenderChildren(HtmlTextWriter 编写器)在 System.Web.UI.Control.Render(HtmlTextWriter 编写器)在 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter 编写器,ControlAdapter 适配器)在 System.Web.UI .Control.RenderControl(HtmlTextWriter writer,ControlAdapter 适配器)位于 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection 子级)在 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)在 System.Web.UI.Page.Render(HtmlTextWriter writer)在 System.Web.UI .Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter 适配器)位于 System.Web.UI.Control.RenderControl(HtmlTextWriter writer,ControlAdapter 适配器)位于System.Web.UI.Control.RenderControl(HtmlTextWriter writer)在System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)在System.Web.UI.Page.HandleError(异常e)在System.Web.UI .Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint, 布尔 includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 在 System.Web.UI.Page.ProcessRequest() 在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) 在 System.Web.UI.Page .ProcessRequest(HttpContext context) 在 ASP.reports_rptresultchart_aspx.ProcessRequest(HttpContext context) 中c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\466f50e4\198c9161\App_Web_jolxexts.2.cs:System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication 的第 0 行。 IExecutionStep.Execute() 在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,布尔& CompletedSynchronously)

在这里,我无法确切地找到为什么目录 c:\TempImageFiles 出现目录错误,因为我没有在整个代码中使用此路径。

请任何人帮助我解决这一问题。

I am using a Chart control in my website. the code and chart control is working perfectly on my local machine. But when i am deploying it on web server its giving error. I have also change version of my site to 4.0 and given all the tab and references in web.config

The Error is

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.DirectoryNotFoundException: Invalid temp directory in chart handler configuration [c:\TempImageFiles]. at System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.Inspect() at System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ParseParams(String parameters) at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeParameters() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.get_Settings() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.InitializeControllerFile() at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.EnsureInitialized(Boolean hardCheck) at System.Web.UI.DataVisualization.Charting.Chart.GetImageStorageMode() at System.Web.UI.DataVisualization.Charting.Chart.get_CurrentImageLocation() at System.Web.UI.DataVisualization.Charting.Chart.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Page.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.reports_rptresultchart_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\466f50e4\198c9161\App_Web_jolxexts.2.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Here, I cannot find exactly why the directory error is giving for directory c:\TempImageFiles as i havent used anywhere in my entire code for this path.

Please can any one help me on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧 2024-12-06 04:38:34

将以下条目添加到 Web 配置的 appsettings 部分。

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

如果那里已经有一个条目,则用该条目替换它。

编辑

相反,您可以提供文件夹的路径

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

或者有 这里有一篇文章,应该会给你很多值得尝试的东西。

Add the following entry to the appsettings section of your web config.

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

If there is already an entry there then replace it with this one.

EDIT

Instead you could supply a path to your folder

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

Alternatively there is an article here that should give you lots of things to try.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文