Sunday, August 14, 2016

The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both

Resolving the error message " The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' "

First Solution:
The first solution to this type of error is to download and install the  Microsoft Report Viewer 2010 Redistributable Package called the ReportViewer.exe which can be found here. Once this file has been downloaded and installed the issue will be resolved

Second Solution:
This second solution mainly depends on which version of the Microsoft Report Viewer you want in the solution. The first step will be to navigate to the assembly folder under windows folder and copy out the required version dll to either the bin or package folder and reference it directly from there into the required class library in the solution. The dll's in the assembly can not be accessed through the GUI on the windows operating system but can be accessed through the command line interface.
For the Webforms dll navigate to :

C:\Windows\assembly\GAC_MSIL>cd Microsoft.ReportViewer.WinForms
For the Common dll navigate to :
C:\Windows\assembly\GAC_MSIL>cd Microsoft.ReportViewer.Common



Based on the dll required you will make a final navigation into the dll's folder for the version 8.0.0.
you will type cd 8.0.0.0__b03f5f7f11d50a3a and press enter. They execute a copy command from the command line interface to copy the dll from the folder to an accessible directory like the document or download folder in the operating system.
Wikihow has an article on how you can do that here
Third Solution:
Find all the references the these dll files inside the web.config file in solution and manually change the numbers from one to another. So if its the version 8 you want then you must change all the places where 9.0.0.0.0 exist to 8.0.0.0.0. Also ensure you check inside the bin folder for web.config files there as well and if such files exist then you should change the referenced versions in this files to the desired one as well.

No comments:

Post a Comment

How To Upgrade (Flash) Linksys' WRT54G/GL/GS Firmware to Tomato Firmware For IP Address and Bandwidth Monitoring

As a System Administrator one is usually faced with the challenge of providing the best possible technology solution within the confinem...