Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to create component 'reportviewer'. the error message follows 'system.runtime.interopservices.comexception' vs 2015

Tags:

c#

I have tried resetting toolbox and i updated 'microsoft.reporting.winforms' packages to v11 but still same error occurs. Failed to create component 'ReportViewer'. The error message follows 'System.Runtime.Interopservices.COMexception'.A reference to the component 'microsoft.reporting.winforms' already exists in the project.

like image 257
Hacked user Avatar asked Mar 01 '17 10:03

Hacked user


4 Answers

I had a reference to microsoft.reporting.winforms version 10.0.0.0 . I removed it from reference and downloaded report viewer for visual studio 2015.Then,I added a reference to microsoft.reporting.winforms version 12.0.0.0 .I was able to use the report viewer. Hopefully,it works.

like image 154
Hacked user Avatar answered Oct 17 '22 06:10

Hacked user


I'm currently using VS2017 v15.9.21 and I had to develop some changes in an old project .NET Framework 4.5.2
I was following the instructions in this post:
Integrating Reporting Services Using the Report Viewer Controls - Get Started

But it gives me an error when I was trying to add the Report Viewer Control from the toolbox.
I was executing the nuget command:

Install-Package Microsoft.ReportingServices.ReportViewerControl.WebForms

And the VS keeps throwing me this error failing to create the component because of some assembly from the last version Microsoft.ReportingServices.ReportViewerControl.Winforms 150.1404.0:

Failed to create component 'Report Viewer'

So I decided to downgrade the version to the last 140 version number

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

And voilà!
Works like a charm.

Report viewer control in windows form

like image 24
Ivan-San Avatar answered Oct 17 '22 05:10

Ivan-San


Just remove microsoft.reporting.winforms from the reference. It works for me. Hope it will work for you.

like image 24
Af'faq Avatar answered Oct 17 '22 05:10

Af'faq


As I am using RDLC report in desktop application. so I just removed Microsoft.ReportingServices.ReportViewerControl.WebForms nuget package. I have install it by mistake and install the alternative packages. Microsoft.ReportingServices.ReportViewerControl.Winforms for windows application works for me, but I'm using two more package with it:

Corrected.Microsoft.ReportingServices.ReportViewerControl.Winforms

Microsoft.ReportViewer.WinForms.v12
like image 1
Muhammad Ilyas Avatar answered Oct 17 '22 06:10

Muhammad Ilyas