none
Microsoft Report Viewer Upgrade from 2005 to 2012 RRS feed

  • Question

  • Hi All,

    I have an web application in .net 2.0 with the report viewer references and the report viewer installed on server is 2005.

    Now I am upgrading the application to .net 4.6.2 and need to upgrade the report viewer to 2012 . While removing the old reference and adding the new reference , I am getting the below error. I am using VS2012.

    .net 2.0 web.config : 

    <httpHandlers>
          <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
        </httpHandlers>
        <compilation debug="true" defaultLanguage="c#" targetFramework="4.6.2">
          <assemblies>
            <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
          </assemblies>
          <buildProviders>
            <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
          </buildProviders>
        </compilation>

    Error: 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\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'

    Thursday, May 4, 2017 3:10 PM

Answers

  • Your code is referencing both v8 and v11 of the reportviewer assembly. You need to upgrade all instances. Your config file is trying to use v8 so you should change that to use v11. Note that the public key will have changed as well so update both values in all entries in your config file.

    After you've made these changes then look at the references in all your projects and ensure they all point to v11. Any that are using v8 should be changed.

    Michael Taylor
    http://www.michaeltaylorp3.net

    • Marked as answer by SrikantMishra Thursday, June 29, 2017 2:38 PM
    Friday, May 5, 2017 3:07 PM
    Moderator