类型'Microsoft.Reporting.WebForms.ReportViewer“存在于两个 [英] The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both

查看:1641
本文介绍了类型'Microsoft.Reporting.WebForms.ReportViewer“存在于两个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有所指的9.0.0.0版本Microsoft.ReportViewer.WebForms一个ASP.NET应用程序,我改,指的是11.0.0.0版本Microsoft.ReportViewer.WebForms。现在,当我在我获得以下错误的机器运行2我的应用

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.0. Now when I run my application on 2 of the machines I get following error

编译错误

说明:此请求提供服务所需资源的编译过程中出现错误。请检查下列特定错误详细信息并适当地修改源$ C ​​$ C。

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

编译器错误信息: CS0433:类型'Microsoft.Reporting.WebForms.ReportViewer存在于两个'c:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ReportViewer.WebForms\\9.0.0.0__b03f5f7f11d50a3a\\Microsoft.ReportViewer.WebForms.dll'和'c:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ReportViewer.WebForms\\11.0.0.0__89845dcd8080cc91\\Microsoft.ReportViewer.WebForms.DLL'

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

我已经确保了在任何地方我的web.config版本号更新为11.0.0.0

I have ensured that everywhere in my web.config version number is updated to 11.0.0.0

推荐答案

我试着在web.config中添加dependentAssembly但是这并没有帮助。

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>

然而,由于公钥在11.0.0.0 DLL已经改变了它并没有帮助。

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

最后,我能够通过添加在web.config中qualifyAssembly节点来解决问题。

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" />

这篇关于类型'Microsoft.Reporting.WebForms.ReportViewer“存在于两个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆