Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.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# ReportViewer错误-报告的定义;这是无效的。无法加载文件或程序集Microsoft.ReportViewer.ProcessingObject模式_C#_.net_Winforms_Reportviewer - Fatal编程技术网

C# ReportViewer错误-报告的定义;这是无效的。无法加载文件或程序集Microsoft.ReportViewer.ProcessingObject模式

C# ReportViewer错误-报告的定义;这是无效的。无法加载文件或程序集Microsoft.ReportViewer.ProcessingObject模式,c#,.net,winforms,reportviewer,C#,.net,Winforms,Reportviewer,我的项目中有ReportViewer。在Vsual Studio 2012的InstallShield中创建此文件的.exe时,我将其添加到Microsoft ReportViewer 2010的可再发行文件中 当我在Windows 8上安装应用程序时,每个ReportViewer都会正确显示其报告 我在Windows XP上遇到问题,ReportViewer加载正确,但显示此错误而不是正确的报告: 本地报表处理过程中出错。定义 “报告”无效。报告中出现意外错误 处理 无法加载文件或程序集 Mi

我的项目中有ReportViewer。在Vsual Studio 2012的InstallShield中创建此文件的.exe时,我将其添加到Microsoft ReportViewer 2010的可再发行文件中

当我在Windows 8上安装应用程序时,每个ReportViewer都会正确显示其报告

我在Windows XP上遇到问题,ReportViewer加载正确,但显示此错误而不是正确的报告:

本地报表处理过程中出错。定义 “报告”无效。报告中出现意外错误 处理

无法加载文件或程序集 Microsoft.ReportViewer.ProcessingObjectMode.Version=11.0.0。, 区域性=中性,PublicKeyToken=89845DC80CC91或其 依赖项。此系统找不到指定的文件

我保证在
参考资料中添加了Microsoft.ReportViewer.Winfroms 11.0.0.0
Copy Local=true


如何解决此问题?

发现此错误意味着您缺少Microsoft.ReportViewer.PorcessingObjectMode.dll
版本11.0.0.0
。有一种解决方案:

在您的
Windows 8
计算机上执行以下操作:

  • 打开dos命令提示符(按START+R,然后键入cmd并按ENTER键)

  • 键入
    cd..
    直到进入
    C:\>
    Type
    cd-windows\assembly\gac\u-msil\Microsoft.ReportViewer.pro*
    并按enter键

  • 只需键入
    cd 11*

  • 然后键入
    copy*c:\

  • .dll
    将被复制到
    C
    目录

  • 此文件只需复制到
    Windows XP机器上的
    程序文件
    ,然后复制到安装应用程序的文件夹中即可


  • 希望它对其他人有帮助,因为我长期以来一直在研究这个问题。

    马雷克的回答很好,对我很有帮助,我只是想添加一个我需要的额外文件。除了

    Microsoft.ReportViewer.ProcessingObjectModel.dll
    
    我还需要

    Microsoft.SqlServer.Types.dll
    
    (我在一个有SQLServer但没有Reporting Services的服务器上运行这个文件,所以可能这就是第二个文件丢失的原因。)

    正如Marek指出的,您需要使用命令提示符复制该文件,因为GAC_MSIL中的DLL对Windows资源管理器是隐藏的,因此如果使用资源管理器搜索它们,您将看不到它们。 我被难住了,因为我正在生成一个带有日常任务的PDF,所以我一直在日志文件中看到一个神秘的错误
    “在本地报表处理过程中发生了一个错误。”
    我从来没有看到ReportViewer的脸,它至少告诉你丢失的文件

    为了解决这个问题,我创建了一个快速测试程序并显示了ReportViewer,这使我更清楚地知道我需要哪些DLL:

    我对标记为答案的回复投了更高的票,因为事实上,我缺少.dll-但我没有按照@Marek建议的方式修复它。我正在使用VS2013并安装Microsoft。Reporting nuget软件包修复了此问题。我建议任何有此问题的人尝试此方法。这样,您将自动获得所有依赖项

    开始时

    安装'Microsoft.Report.Viewer''ReportViewer.WebForms''Microsoft.ReportViewer.WinForms',以及'Microsoft.SqlServer.Types'的软件包是必需的

    然后应该检查web.config中的一些标记

    <system.web>
        <compilation debug="true" targetFramework="4.5">
            <buildProviders>
                <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
            </buildProviders>
            <assemblies>
                <add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
                <add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
            </assemblies>
        </compilation>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false" />
    
    
    

    
    
    老兄,这正是我需要知道的。你无法相信这为我节省了多少时间,让我想出了“正确”的方法,昨天我拿着半途而废的答案和其他毫无用处的废话拔了头发……但这……这是解决我问题的关键。谢谢你!Nuget是最好的(对大多数事情来说…)!在我的开发中,计算机正在工作。在分段环境中,我遇到错误
    无法加载文件或程序集Microsoft.SqlServer.Types
    。如何获取或下载单个Microsoft.SqlServer.Types.dll或Windows 2008R2服务器的最小可再发行版本?您的快速测试程序如何?源代码可用?QUENKIET,我将使用e如果我能找到测试程序,我可能已经删除了它;我会让你知道。我想我所做的只是将报表查看器拖到一个窗体上,然后在我的服务器上运行该程序,这样我就可以看到服务器丢失了哪些文件。在我的情况下,我可以从我的工作站获取文件Microsoft.SqlServer.Types.dll并将其复制到服务器上。我不确定如何操作我的工作站得到了文件--可能是Visual Studio安装的?
        <assemblyBinding>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    <system.webServer>
        <handlers>
            <add name="ReportViewerWebControlHandler" verb="*" path="Reserved.ReportViewerWebControl.axd" preCondition="integratedMode" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
        </handlers>
        <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>