Error Report Viewer

chhean daravuth 1 Reputation point
2020-12-03T08:47:08.42+00:00

Dear all

May you help me? I update my project from visual studio 2010 to 2012 and update report viewer from version 10.0.0.0 to 11.0.0.0
but i have issue with report viewer when i run project the below.

Error 4 The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'

Can you tell me ? how to fix this problem?
I try remove reference ready but it still error.

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2020-12-04T03:47:10.857+00:00

    Hello @chhean daravuth ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    Please right-click your project > click Unload Project > right-click it again > click Edit XXXX.XXproj and then check this .XXproj file, does this file include codes like:

    <Reference Include="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=XXX, processorArchitecture=MSIL">  
          <SpecificVersion>False</SpecificVersion>  
          <HintPath>..\..\..\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__XXXX\Microsoft.ReportViewer.WebForms.dll</HintPath>  
    </Reference>  
    <Reference Include="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken= XXXX, processorArchitecture=MSIL">  
          <SpecificVersion>False</SpecificVersion>  
          <HintPath>..\..\..\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__ XXXX\Microsoft.ReportViewer.WebForms.dll</HintPath>  
    </Reference>  
    

    If you can see two different versions of this WebForms.dll are referenced, please try to annotate the codes lines which are related to the older version of WebForms.dll and then reload the project(right-click your project > Reload Project), and rebuild the project again.

    If this issue still persists, could you please share the related code snippets of the proj file(hide the privacy information and replace them with XXXX) with me for further check? Besides, did you perform some other operations when updating Report Viewer from 10.0.0.0 to 11.0.0.0?

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.