简体   繁体   English

ReportViewer错误 - 报告的定义“无效。无法加载文件或程序集Microsoft.ReportViewer.ProcessingObjectMode

[英]ReportViewer error - The definition of the report " is invalid. Could not load file or assembly Microsoft.ReportViewer.ProcessingObjectMode

I have ReportViewer in my project. 我的项目中有ReportViewer。 When I create .exe of this file in InstallShield in Vsual Studio 2012 I add into Redistributables Microsoft ReportViewer 2010 . 当我在Vsual Studio 2012中的InstallShield中创建此文件的.exe时,我添加到Redistributables Microsoft ReportViewer 2010

When I do install my app on Windows 8 - every ReportViewer displays it's report correctly. 当我在Windows 8上安装我的应用程序时 - 每个ReportViewer都会正确显示它的报告。

I'm having problem on Windows XP the ReportViewer loads correctly but displayes this error instead of correct Report: 我在Windows XP上遇到问题,ReportViewer正确加载但显示此错误而不是正确的报告:

An error occurred during local report processing. 本地报告处理期间发生错误。 The definition of the report " is invalid. An unexpected error ocurred in Report Processing. 报告的定义“无效。报告处理中出现意外错误。

Could not load file or assembly Microsoft.ReportViewer.ProcessingObjectMode. 无法加载文件或程序集Microsoft.ReportViewer.ProcessingObjectMode。 Version =11.0.0., Culture=neutral, PublicKeyToken=89845dc8080cc91 or one of its dependencies. Version = 11.0.0。,Culture = neutral,PublicKeyToken = 89845dc8080cc91或其依赖项之一。 this system cannot find the file specified. 这个系统找不到指定的文件。

I ensure you that in references I have added Microsoft.ReportViewer.Winfroms 11.0.0.0 and Copy Local = true . 我确保你在references I have added Microsoft.ReportViewer.Winfroms 11.0.0.0Copy Local = true

How can I solve this issue? 我该如何解决这个问题?

I upvoted the reply marked as the answer because I was, infact, missing .dlls - but I did not fix it in the manner @Marek suggested. 我赞成了标记为答案的答复,因为我实际上是缺少.dlls - 但我没有以@Marek建议的方式修复它。 I'm using VS2013 and installing the Microsoft.Reporting nuget package fixed the problem. 我正在使用VS2013并安装Microsoft.Reporting nuget包修复了这个问题。 I would suggest to anyone with this problem trying this. 我会建议任何有这个问题的人尝试这个。 That way, you automatically get all the dependencies. 这样,您就可以自动获得所有依赖项。

在此输入图像描述

Found out that this error means that you are missing Microsoft.ReportViewer.PorcessingObjectMode.dll version 11.0.0.0 . 发现此错误意味着您缺少Microsoft.ReportViewer.PorcessingObjectMode.dll version 11.0.0.0 There is one solution: 有一个解决方案:

On your Windows 8 Machine do following: Windows 8计算机上执行以下操作:

  1. Open dos command prompt (press START + R then type cmd and press ENTER) 打开dos命令提示符(按START + R然后键入cmd并按ENTER键)

  2. Type cd .. until you are on C:\\ > Type Cd windows\\assembly\\gac_msil\\Microsoft.ReportViewer.pro* and press enter 键入cd ..直到您在C:\\ >键入Cd windows\\assembly\\gac_msil\\Microsoft.ReportViewer.pro*并按Enter键

  3. Just type cd 11* 只需输入cd 11*

  4. Then type copy * c:\\ 然后输入copy * c:\\

  5. The .dll will be copied to your C directory. .dll将被复制到您的C目录中。

  6. This file simply copy into your Program Files on Windows XP machine to folder where your application has been installed. 此文件只是复制到Windows XP machine上的Program Files到安装了应用程序的文件夹。

Hope it helps to others as I was stuct with this issue for long time. 希望它对其他人有所帮助,因为我长期坚持这个问题。

Marek's answer is great and helped me, I just wanted to add an additional file that mine needed. Marek的回答非常好并帮助了我,我只想添加一个我需要的附加文件。 In addition to 此外

Microsoft.ReportViewer.ProcessingObjectModel.dll

I also needed 我也需要

Microsoft.SqlServer.Types.dll

(I'm running this from a server that has SQLServer but not Reporting Services so perhaps that's why the 2nd file was missing.) (我是从具有SQLServer但不是Reporting Services的服务器运行的,所以也许这就是第二个文件丢失的原因。)

As Marek pointed out, you need to copy the file using the command prompt because the DLLs in GAC_MSIL are hidden from Windows Explorer, so you won't see them if you search for them using Explorer. 正如Marek指出的那样,您需要使用命令提示符复制文件,因为GAC_MSIL中的DLL在Windows资源管理器中是隐藏的,因此如果使用资源管理器搜索它们,您将看不到它们。 I was stumped because I'm generating a PDF with a daily task, so all I kept seeing in my log file was the cryptic error "An error occurred during local report processing." 我很难过,因为我正在生成一个带有日常任务的PDF,所以我在日志文件中看到的只是一个神秘的错误"An error occurred during local report processing."出错"An error occurred during local report processing." I never saw the ReportViewer's face, which at least tells you the missing file. 我从未见过ReportViewer的脸,至少告诉你丢失的文件。

To troubleshoot this, I created a quickie test program and displayed the ReportViewer, which made it more clear which DLLs I needed: 为了解决这个问题,我创建了一个quickie测试程序并显示了ReportViewer,它使我更清楚我需要哪些DLL: 在此输入图像描述

For the beginning 一开始

It is necessary for installing nuget packages of 'Microsoft.Report.Viewer' , 'ReportViewer.WebForms' , 'Microsoft.ReportViewer.WinForms' and also 'Microsoft.SqlServer.Types' 安装'Microsoft.Report.Viewer''ReportViewer.WebForms''Microsoft.ReportViewer.WinForms'以及'Microsoft.SqlServer.Types'的 nuget包是必要的。

https://www.nuget.org/packages/ReportViewer.WebForms/ https://www.nuget.org/packages/ReportViewer.WebForms/

https://www.nuget.org/packages/Microsoft.ReportViewer.WinForms/ https://www.nuget.org/packages/Microsoft.ReportViewer.WinForms/

https://www.nuget.org/packages/Microsoft.Report.Viewer/ https://www.nuget.org/packages/Microsoft.Report.Viewer/

https://www.nuget.org/packages/Microsoft.SqlServer.Types/ https://www.nuget.org/packages/Microsoft.SqlServer.Types/

Then it should be check web.config for some tags 然后应检查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" />

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集“Microsoft.ReportViewer” - Could not load file or assembly 'Microsoft.ReportViewer' 无法加载文件或程序集 &#39;Microsoft.ReportViewer.Common,版本 = 11.0.0.0 - Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0 无法加载文件或程序集Microsoft.ReportViewer.WebForms.XmlSerializers - Could not load file or assembly Microsoft.ReportViewer.WebForms.XmlSerializers 无法加载文件或程序集Microsoft.ReportViewer.ProcessingObjectModel,版本= 13.0.0.0 - Could not load file or assembly Microsoft.ReportViewer.ProcessingObjectModel, Version=13.0.0.0 无法加载文件或程序集“ Microsoft.ReportViewer.DataVisualization” - Could not load file or assembly 'Microsoft.ReportViewer.DataVisualization' 无法加载文件或程序集&#39;microsoft.reportviewer.Common version = 11.0.0.0&#39; - could not load file or assembly ' microsoft.reportviewer.Common version=11.0.0.0' 无法加载文件或程序集&#39;Microsoft.ReportViewer.ProcessingObjectModel&#39;,版本8 - Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel,' ver 8 "无法加载文件或程序集“Microsoft.ReportViewer.ProcessingObjectModel,版本=10.0.0.0" - Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=10.0.0.0 尽管安装了先决条件,但无法加载程序集Microsoft.ReportViewer.Common - Could not load assembly Microsoft.ReportViewer.Common, despite installing the prerequisites 无法加载文件或程序集“ Microsoft.ReportViewer.Common”或其依赖项之一。 -正在使用文件 - Could not load file or assembly 'Microsoft.ReportViewer.Common' or one of its dependencies. - File is being used
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM