未定义类型"DataVisualization.Charting.Chart". [英] Type 'DataVisualization.Charting.Chart' is not defined.

查看:143
本文介绍了未定义类型"DataVisualization.Charting.Chart".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

尝试构建项目时收到以下错误.

类型'  DataVisualization.Charting.Chart'未定义. 



预先感谢您的帮助.

解决方案

在编译过程中遇到该错误时,还将获得有关在哪个模块上发生错误的信息. />
现在,双击错误,Visual Studio应该将您带到导致错误的行.

关于错误本身,您正在尝试使用一个很可能在您的项目中未引用的库.请参阅: http://msdn.microsoft.com/en-us/library/wkze6zky.aspx [ ^ ]


您似乎没有足够的权限来加载此程序集.您需要使用该框上的MSChart.exe安装图表控件.我不确定在您的托管环境中是否可行.

是否从GAC中提取了System.Web.UI.DataVisualization.Charting.Chart类型?有时有时无法从GAC加载某些程序集.请直接在您的bin目录中添加相应的dll,然后尝试运行您的应用,看看是否可以解决您的问题.

问题可能是由于您在视图中而不是在控制器中引用该类型,在这种情况下,您可能需要将程序集信息定义为web.config设置或页面指令.

 <  组件 > ; 
        <  添加    ="   System.Web.UI.DataVisualization.Charting,版本= 4.0. 0.0,Culture = neutral,PublicKeyToken =< YourPublicKeyToken>(31bf3856ad364e35)" > 
<  /assembly  >                             pre> 

参考:
图表错误
无法加载文件或程序集'System.Web.DataVisualization,版本= 3.5.0.0 ,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一
System.Web.UI .DataVisualization.Charting .net 4.0中缺少错误?


Hello,

I am receiving the following error when I try to build a project.

Type 'DataVisualization.Charting.Chart' is not defined.



Thank you in advance for your help.

解决方案

When you get that error during the compile, you also get information on which line the error occurred at which module.

Now double click the error and Visual Studio should take you exactly to the line causing the error.

Regarding the error itself, you''re trying to use a library which most likely isn''t referenced in your project. See: http://msdn.microsoft.com/en-us/library/wkze6zky.aspx[^]


It looks like you do not have sufficient rights to load this assembly. You need to install the chart control using the MSChart.exe on that box. I''m not sure if it is possible in your hosted environment.

Is the type System.Web.UI.DataVisualization.Charting.Chart picked up from the GAC? It sometimes fails to load some assemblies from the GAC sometimes. Please add the corresponding dll in your bin directory directly and try running your app and see if that works out for you.

The problem might be due to the fact that you are referencing the type in your view and not in your controller, in that case you probably need to define the assembly info as a web.config setting or as a page directive.

<assemblies>
        <add assembly="System.Web.UI.DataVisualization.Charting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=<YourPublicKeyToken>(31bf3856ad364e35)"/>
</assemblies>



REF:
Chart Error
Could not load file or assembly ‘System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies
System.Web.UI.DataVisualization.Charting missing error in .net 4.0?


这篇关于未定义类型"DataVisualization.Charting.Chart".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆