Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SSRS-报表查看器编译错误_C#_Asp.net_Webforms_Ssrs 2008 - Fatal编程技术网

C# SSRS-报表查看器编译错误

C# SSRS-报表查看器编译错误,c#,asp.net,webforms,ssrs-2008,C#,Asp.net,Webforms,Ssrs 2008,当我想用VisualStudio运行报表查看器时,它会导致以下错误 ========================================================================= 编译错误 描述:编译服务此请求所需的资源时出错。请查看以下特定错误详细信息,并适当修改源代码 编译器错误消息:CS0433:类型 “Microsoft.Reporting.WebForms.ReportViewer”在这两个版本中都存在 'c:\Windows\assembly\GA

当我想用VisualStudio运行报表查看器时,它会导致以下错误

========================================================================= 编译错误

描述:编译服务此请求所需的资源时出错。请查看以下特定错误详细信息,并适当修改源代码

编译器错误消息:CS0433:类型 “Microsoft.Reporting.WebForms.ReportViewer”在这两个版本中都存在 'c:\Windows\assembly\GAC\MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0\Uuu b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' 和 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845DCD80CC91\Microsoft.ReportViewer.WebForms.DLL'

源错误:

[System.Diagnostics.DebuggerNonUserCodeAttribute()]
       private global::Microsoft.Reporting.WebForms.ReportViewer @__BuildControlReportViewerSummary() {
          global::Microsoft.Reporting.WebForms.ReportViewer @__ctrl;
这是不是意味着我丢失了.dll文件


谢谢。

该问题与缺少DLL文件完全无关,而是与同一目录(%Windows%\assembly)中不同DLL文件中存在的相同
ReportViewer
命名空间有关。尝试以下解决方案:

  • 检查
    \u bin\u deployableAssemblies
    目录中较旧版本的
    ReportViewer
    。删除与之相关的所有文件,并使用Microsoft.ReportViewer.11.0引用

  • 检查web.config文件中
    Microsoft.ReportViewer.WebForms
    命名空间的重复声明,如果存在,请删除旧的声明

  • 在web.config文件中添加
    qualifyAssembly
    元素:

    <qualifyAssembly partialName="Microsoft.ReportViewer.WebForms" fullName="Microsoft.ReportViewer.WebForms,version=11.0.0.0,culture=neutral,publicKeyToken=89845dcd8080cc91" />
    
    
    
  • 如果问题仍然存在,请删除与
    Microsoft.ReportViewer.WebForms
    命名空间相关的所有引用,清理整个解决方案(删除引用到旧版本的DLL文件),添加具有最新版本的新引用,然后重新生成解决方案文件。此外,您还可以尝试从程序集目录中删除/卸载一个冲突的DLL文件

  • 注意:请记住,两个版本(10.0和11.0)都有不同的
    PublicKeyToken
    属性值,因此
    bindingRedirect
    节点中的
    dependentAssembly
    技巧不起作用

    与CS0433相关的问题: