为什么 .net 4.0 图表控件不能在 Visual Studio 2010 中工作?
.net 图表控件被宣传为内置于 .net 4.0 中。但是,它们不适用于 Visual Studio 2010 Pro 或 Visual Web Developer 2010 Express。我收到错误 System.Web.HttpException:执行 ChartImg.axd 的子请求时出错。
如果图表设置不正确,这听起来像是来自 .net 3.5 的消息。但同一页面的底部显示“版本信息:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.1”
有谁知道为什么这不起作用?
The .net charting controls are advertised as being built into .net 4.0. However, they do not work in Visual Studio 2010 Pro or Visual Web Developer 2010 Express. I get the error, System.Web.HttpException: Error executing child request for ChartImg.axd.
That sounds like the message from .net 3.5 if charting wasn't set up correctly. But the bottom of the same page says, "Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1"
Does anyone know why this doesn't work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
图表 dll 包含在 4.0 中。但是,如果您想使用它,您仍然必须在应用程序 web.config 中配置图表。根据这篇博客文章
http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls -vs-2010-and-net-4-series.aspx
“您可以使用此控件,而无需注册或连接任何配置文件条目。”
我给斯科特发了电子邮件并收到了以下答复。希望这可以帮助某人:
来自:Scott Guthrie [mailto:[电子邮件受保护]]
发送:2010 年 6 月 15 日星期二晚上 10:19
致:凯伦 xxxxx
主题:回复:内置 .Net 4.0 图表控件需要 Web.Config 更新
Karen,您好,
很抱歉 - 我们进行了一项后期更改,最终要求图表控件将一些配置添加到 web.config 才能工作。这样做是为了避免我们在不使用程序集的情况下不必要地加载程序集(这会增加内存)。
抱歉造成混乱,
斯科特
The charting dll's are included in 4.0. However, you still have to configure charting in your app web.config if you want to use it. I spent an inordinate amount of time studying this, based on statements made in this blog post,
http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls-vs-2010-and-net-4-series.aspx
"You can use this control without having to register or wire-up any configuration file entries."
I emailed Scott and received the following answer. Hope this may help someone:
From: Scott Guthrie [mailto:[email protected]]
Sent: Tue 6/15/2010 10:19 PM
To: Karen xxxxx
Subject: RE: Built-in .Net 4.0 Charting Controls Require Web.Config Updates
Hi Karen,
Sorry about that - there was a late change that we made that ended up requiring that the charting controls have some configuration added to web.config to work. This was done to avoid us loading the assembly unnecessarily (which increases memory) for cases where it is not being used.
Sorry for the confusion,
Scott
web.config 中的 httpHandler 部分仍然需要以下内容。
It still needs the following in the httpHandler section in web.config.