[英]SSRS - Report Viewer Compilation Error
When I want run the report viewer with Visual Studio, it cause the following error. 当我想使用Visual Studio运行报表查看器时,它会导致以下错误。
========================================================================= Compilation Error ================================================== =======================编译错误
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. 请查看以下特定的错误详细信息,并适当地修改您的源代码。
Compiler Error Message: CS0433: The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\\Windows\\assembly\\GAC_MSIL\\Microsoft.ReportViewer.WebForms\\10.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' 编译器错误消息:CS0433:类型'Microsoft.Reporting.WebForms.ReportViewer'同时存在于'c:\\ Windows \\ assembly \\ GAC_MSIL \\ Microsoft.ReportViewer.WebForms \\ 10.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'
Source Error: 源错误:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::Microsoft.Reporting.WebForms.ReportViewer @__BuildControlReportViewerSummary() {
global::Microsoft.Reporting.WebForms.ReportViewer @__ctrl;
Is that mean i missing the .dll file ??? 这是否意味着我缺少.dll文件???
Thank you. 谢谢。
The problem is totally unrelated to missing DLL file, instead it should related to same ReportViewer
namespace exists in different DLL files at same directory (%Windows%\\assembly). 该问题与缺少DLL文件完全无关,相反,它应该与同一目录(%Windows%\\ assembly)的不同DLL文件中存在的相同ReportViewer
命名空间有关。 Try following solutions: 尝试以下解决方案:
Check older version of ReportViewer
in _bin_deployableAssemblies
directory. 在_bin_deployableAssemblies
目录中检查ReportViewer
较旧版本。 Delete all files related to it, and use Microsoft.ReportViewer.11.0
references. 删除与此有关的所有文件,并使用Microsoft.ReportViewer.11.0
引用。
Check duplicate declarations of Microsoft.ReportViewer.WebForms
namespace in web.config file, remove older one if exists. 检查web.config文件中Microsoft.ReportViewer.WebForms
命名空间的重复声明,如果存在则删除较旧的声明。
Add qualifyAssembly
element in web.config file: 在web.config文件中添加qualifyAssembly
元素:
<qualifyAssembly partialName="Microsoft.ReportViewer.WebForms" fullName="Microsoft.ReportViewer.WebForms,version=11.0.0.0,culture=neutral,publicKeyToken=89845dcd8080cc91" />
If the problem still persists, remove all references related to Microsoft.ReportViewer.WebForms
namespace, clean entire solution (deleting DLL files referenced to older version), add new references with latest version then rebuild the solution file. 如果问题仍然存在,请删除与Microsoft.ReportViewer.WebForms
命名空间相关的所有引用,清理整个解决方案(删除引用到较早版本的DLL文件),添加具有最新版本的新引用,然后重新生成解决方案文件。 Also, you may trying remove/uninstall one of conflicted DLL files from assembly directory. 另外,您可以尝试从程序集目录中删除/卸载冲突的DLL文件之一。
NB: Remember that both versions (10.0 & 11.0) have different PublicKeyToken
property value, hence bindingRedirect
trick in dependentAssembly
node doesn't work. 注意:请记住,两个版本(10.0和11.0)具有不同的PublicKeyToken
属性值,因此, dependentAssembly
节点中的bindingRedirect
技巧不起作用。
Related issues with CS0433: CS0433的相关问题:
C#: The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both ReportingServicesWebUserInterface.dll and Microsoft.ReportViewer.WebForms.dll C#:类型“ Microsoft.Reporting.WebForms.ReportViewer”同时存在于ReportingServicesWebUserInterface.dll和Microsoft.ReportViewer.WebForms.dll中
The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 两者中都存在类型'Microsoft.Reporting.WebForms.ReportViewer'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.