Thursday, January 12, 2012

Problem with Report Viewer

Problem

There is version conflict when adding two versions of Microsoft.ReportViewer.WebForms 8.0 and 9.0.

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

Solution

Adding following code in web.config before the <configuration>  tag ends

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.ReportViewer.WebForms"
                          publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="8.0.0.0"
                        newVersion="9.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

No comments:

Post a Comment