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

I have an ASP.NET application that referenced Microsoft.ReportViewer.WebForms version 9.0.0.0, I changed the link to Microsoft.ReportViewer.WebForms version 11.0.0.0. Now, when I run my application on 2 computers, I get the following error:

Compilation error

Description: An error occurred while compiling the resource required to service this request. Review the specific error data below and modify the source code accordingly.

Compiler Error Message: CS0433: The type "Microsoft.Reporting.WebForms.ReportViewer" exists as in "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 \ 11.0.0.0__89845dcd8080cc91 \ Microsoft.ReportViewer.WebForms.DLL'

I made sure everywhere in my web.config version number was updated to 11.0.0.0

+4
source share
2 answers

I tried adding dependAssembly to web.config, but that didn't 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, this did not help, since the PublicKeyToken has changed in the DLL version 11.0.0.0.

Finally, I was able to solve the problem 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" /> 
+5
source

My decision. I had an old version of ReportViewer in the _bin_deployableAssemblies folder. I removed all of this and used the links from the "packages \ Microsoft.ReportViewer.11.0.3366.16 \ lib" folder.

0
source

All Articles