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

后端 未结 2 796

I have a ASP.NET application which was referring Microsoft.ReportViewer.WebForms of version 9.0.0.0, I changed to refer to Microsoft.ReportViewer.WebForms of version 11.0.0.

相关标签:
2条回答
  • 2021-01-12 16:43

    My solution. I had old version of ReportViewer in _bin_deployableAssemblies folder. I deleted all from this, and use references from 'packages\Microsoft.ReportViewer.11.0.3366.16\lib' folder.

    0 讨论(0)
  • 2021-01-12 17:00

    I tried adding dependentAssembly in web.config but that did not help.

    <dependentAssembly>
      <assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="89845dcd8080cc91" />
      <bindingRedirect oldVersion="8.0.0.0-10.0.0.0" newVersion="11.0.0.0" />
    </dependentAssembly>
    

    However it did not help as PublicKeyToken has changed in 11.0.0.0 dll.

    Finally I was able to resolve the issue by adding qualifyAssembly node in web.config

    <qualifyAssembly partialName="Microsoft.ReportViewer.WebForms" fullName="Microsoft.ReportViewer.WebForms,version=11.0.0.0,culture=neutral,publicKeyToken=89845dcd8080cc91" />
    
    0 讨论(0)
提交回复
热议问题