C# 未能创建组件';reportviewer';。错误消息如下';system.runtime.interopservices.comexception';vs 2015

C# 未能创建组件';reportviewer';。错误消息如下';system.runtime.interopservices.comexception';vs 2015,c#,C#,我已尝试重置工具箱,并将“microsoft.reporting.winforms”软件包更新到v11,但仍然出现相同的错误。 未能创建组件“ReportViewer”。错误消息出现在“System.Runtime.Interopservices.COMexception”之后。项目中已存在对组件“microsoft.reporting.winforms”的引用。我曾引用过microsoft.reporting.winforms 10.0.0版。我将其从引用中删除并下载了visual studi

我已尝试重置工具箱,并将“microsoft.reporting.winforms”软件包更新到v11,但仍然出现相同的错误。
未能创建组件“ReportViewer”。错误消息出现在“System.Runtime.Interopservices.COMexception”之后。项目中已存在对组件“microsoft.reporting.winforms”的引用。

我曾引用过microsoft.reporting.winforms 10.0.0版。我将其从引用中删除并下载了visual studio 2015报表查看器。然后,我添加了对microsoft.reporting.winforms 12.0.0.0版的引用。我可以使用报表查看器。希望它能工作。

只需从引用中删除microsoft.reporting.winforms即可。它对我有用。希望它能为您工作。

我也遇到了同样的问题,我通过在Manage NuGet软件包中安装
CrystalDecisions.Windows.Forms
解决了这个问题。

我目前使用的是VS2017 v15.9.21,我不得不在一个旧项目.NET Framework 4.5.2中进行一些更改
我是按照这篇文章中的说明做的:

但是当我试图从工具箱添加报表查看器控件时,它给了我一个错误
我正在执行nuget命令:

Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms
由于上一版本的某些程序集,VS不断向我抛出无法创建组件的错误
Microsoft.ReportingServices.ReportViewerControl.Winforms 150.1404.0

因此,我决定将版本降级到最后140个版本号

Install-Package Microsoft.ReportingServices.ReportViewerControl.Winforms -Version 140.1000.523

工作起来很有魅力


当我在桌面应用程序中使用RDLC报表时。所以我刚刚删除了
Microsoft.ReportingServices.ReportViewerControl.WebForms
nuget包。我错误地安装了它,并安装了替代软件包
Microsoft.ReportingServices.ReportViewerControl.Winforms
for windows应用程序适用于我,但我还使用了另外两个软件包:

Corrected.Microsoft.ReportingServices.ReportViewerControl.Winforms

Microsoft.ReportViewer.WinForms.v12

请与我们共享您的代码,以便我们能够帮助您我在win forms中使用工具箱报表查看器控件时遇到问题。将reference的版本更改为reporting.winforms为12.0.0.0,对我来说效果很好