简体   繁体   English

命名空间“Microsoft”中不存在类型或命名空间名称“Reporting”

[英]The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft'

I simply get the following error:我只是收到以下错误:

The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)命名空间“Microsoft”中不存在类型或命名空间名称“Reporting”(您是否缺少程序集引用?)

after adding this to my code:将此添加到我的代码后:

protected global::Microsoft.Reporting.WebForms.ReportViewer ReportViewer1;

I've seen some solutions saying I must add some assemblies.我已经看到一些解决方案说我必须添加一些程序集。 but none of them worked.但他们都没有工作。 here is an example:这是一个例子:

<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

can anyone help me with this?谁能帮我这个?

In my case I needed to actually install Microsoft Report Viewer on the troublesome machine. 在我的情况下,我需要在麻烦的机器上实际安装Microsoft Report Viewer。

Of course, other ones are available, it can be worked out which from the Version= on the dll which one is needed. 当然,其他的可用,可以从Version=在dll上得到哪一个需要。 In my case I needed version 11 (the 2012 one). 就我而言,我需要第11版(2012年版)。

I did it by right-clicking on References folder in my project and then selecting Add Reference . 我是通过右键单击项目中的References文件夹然后选择Add Reference来完成的 and then adding Assemblies > Extensions > Microsoft.ReportViewer to the references. 然后将Assemblies> Extensions> Microsoft.ReportViewer添加到引用。

All these installs didn't work for me at all. 所有这些安装对我来说根本不起作用。 What worked for me inside Visual Studio 2015 is installing the following two packages (I only needed these two) from NuGet (menu Project > Manage NuGet Packages): 在Visual Studio 2015中对我有用的是从NuGet安装以下两个包(我只需要这两个)(菜单Project> Manage NuGet Packages):

  • Microsoft.ReportViewer.Common.VS2010 Microsoft.ReportViewer.Common.VS2010
  • Microsoft.ReportViewer.WinForms.VS2010 Microsoft.ReportViewer.WinForms.VS2010

The references were added to current project automatically. 引用已自动添加到当前项目中。

从Nuget Package Manager安装ReportViewer

Just install SSDT . 只需安装SSDT Then you need to remove the broken reference and re-add it from Assemblies > Extensions. 然后,您需要删除损坏的引用并从Assemblies> Extensions重新添加它。

从以下位置导入:C:\\ Program Files(x86)\\ Microsoft Visual Studio 11.0 \\ ReportViewer \\ Microsoft.ReportViewer.WebForms.dll

I received this error when attempting to install a newer version of the SQL Server Reporting Services Report Viewer Control than the current target version of .NET.我在尝试安装比当前目标版本 .NET 更新的 SQL 服务器报告服务报告查看器控件时收到此错误。

Installing an earlier version of the nuget resolved this eg instead of version 15, installing version 14 worked安装早期版本的 nuget 解决了这个问题,例如,而不是版本 15,安装版本 14 有效

Microsoft.ReportingServices.ReportViewerControl.WebForms nuget Microsoft.ReportingServices.ReportViewerControl.WebForms nuget

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误 CS0234 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting”(您是否缺少程序集引用?) - Error CS0234 The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (Are you missing an assembly reference?) 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileIO” - The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' 类型或名称空间名称“ DirectX”在名称空间“ Microsoft” Windows 8.1中不存在 - The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' Windows 8.1 命名空间“Microsoft”中不存在类型或命名空间名称“设备” - The type or namespace name 'Devices' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Bot”? - The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'? 类型或名称空间名称“ FriendlyUrls”在名称空间“ Microsoft.AspNet”中不存在 - The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' 命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation” - The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Azure” - The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus”? - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'? 类型或名称空间名称“ Lync”在名称空间“ Microsoft”中不存在 - The type or namespace name 'Lync' does not exist in the namespace 'Microsoft'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM