我有一个 ASP.NET 应用程序,它引用版本 9.0.0.0 的 Microsoft.ReportViewer.WebForms,我更改为引用版本 11.0.0.0 的 Microsoft.ReportViewer.WebForms。现在,当我在两台机器上运行应用程序时,出现以下错误
编译错误
描述:编译服务此请求所需的资源期间发生错误。请查看以下具体错误详细信息并适当修改您的源代码。
编译器错误信息:CS0433:类型“Microsoft.Reporting.WebForms.ReportViewer”存在于“c:\ Windows \ assembly \ GAC_MSIL \ Microsoft.ReportViewer.WebForms \ 9.0.0.0__b03f5f7f11d50a3a \ Microsoft.ReportViewer.WebForms.dll”和“c:\”中Windows\程序集\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'
我已确保我的 web.config 中的所有版本号都更新为 11.0.0.0
我尝试在 web.config 中添加 dependentAssembly 但这没有帮助。
<dependentAssembly>
<assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="8.0.0.0-10.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
然而它并没有帮助,因为 PublicKeyToken 在 11.0.0.0 dll 中已更改。
最后我通过在 web.config 中添加 QualifyAssembly 节点解决了该问题
<qualifyAssembly partialName="Microsoft.ReportViewer.WebForms" fullName="Microsoft.ReportViewer.WebForms,version=11.0.0.0,culture=neutral,publicKeyToken=89845dcd8080cc91" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)