Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 类型或命名空间名称';WinForms';不存在_C#_.net_Visual Studio 2010_Reference_Assembly References - Fatal编程技术网

C# 类型或命名空间名称';WinForms';不存在

C# 类型或命名空间名称';WinForms';不存在,c#,.net,visual-studio-2010,reference,assembly-references,C#,.net,Visual Studio 2010,Reference,Assembly References,当我试图完成我的项目时,出现了以下错误: 类或命名空间“Microsoft.Reporting”中不存在类型或命名空间名称“WinForms”(是否缺少程序集引用?) 我已经添加了以下参考: 使用System.Windows.Forms 使用Microsoft.Reporting.WinForms 使用Microsoft.Reporting.WebForms 我正在使用VisualStudio2010和.NETFramework4.0 如何修复此错误 谢谢,即使您添加了,也很可能没有对Micr

当我试图完成我的项目时,出现了以下错误:

类或命名空间“Microsoft.Reporting”中不存在类型或命名空间名称“WinForms”(是否缺少程序集引用?)

我已经添加了以下参考:

使用System.Windows.Forms

使用Microsoft.Reporting.WinForms

使用Microsoft.Reporting.WebForms


我正在使用VisualStudio2010和.NETFramework4.0

如何修复此错误


谢谢,即使您添加了,也很可能没有对Microsoft.Reporting dll的引用。您需要在生成此错误的项目中添加对Microsoft.Reporting dll的引用。我通常在VS中使用解决方案资源管理器,右键单击项目->添加引用

请注意,在“添加引用”对话框中,通常有多个源可用


另外,我说的是Microsoft.Reporting dll,但因为我假设Microsoft.Reporting.WinForms是该dll中的名称空间,但可能有一个单独的Microsoft.Reporting.WinForms dll

您是否将其作为Windows窗体项目启动?您是否已将程序集引用添加到您的项目中?这是我在将错误消息粘贴到google时发现的。需要谷歌搜索方面的帮助吗?我已经添加到项目中,不仅是在类中。愚蠢的问题,而且我认为Microsoft.Reporting程序集只显示安装了SQL Server Reporting Services redistributable,安装Visual Studio时选择了Reporting Services,或者存在以前安装的SQL Server Reporting Services报表服务器。