简体   繁体   English

报告查看器 Web 控件 HTTP 处理程序尚未在应用程序的 web.config 文件中注册

[英]The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file

    The Report Viewer Web Control HTTP Handler has not been registered in the application's 
web.config file.  Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = 
"Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file

This error is coming.这个错误来了。 I have already mentioned this line in http handler but still getting this error我已经在 http 处理程序中提到了这一行,但仍然出现此错误

<add path="Reserved.ReportViewerWebControl.axd" verb="*"   type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0,    Culture=neutral, PublicKeyToken=0000000000000000" validate="false" />

my html page markup is as follow我的 html 页面标记如下

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Button ID="btnsubmit" runat="server" OnClick="GenerateReportButton_Click" />
    <rsweb:ReportViewer ID="ReportViewer1" runat="server">
    </rsweb:ReportViewer>
</asp:Content>

Web config assemblies section is as follows: Web 配置组件部分如下:

<assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>

I was having the very same problem.我遇到了同样的问题。 What happened was I put the Report loading routine on Page_Load, and didn't wrap it in if (!IsPostBack) .发生的事情是我将报告加载例程放在 Page_Load 上,并且没有将其包装在if (!IsPostBack) The ReportViewer makes a POST to the page, and that was triggering Page_Load and reloading the report, somehow messing it up. ReportViewer 对页面进行 POST,这触发了 Page_Load 并重新加载报告,不知何故弄乱了它。 After putting everything inside if (!IsPostBack) , it worked like a charm.在将所有内容放入if (!IsPostBack) ,它就像一个魅力。

Could you check your web.config for handlers registered or not for ReportViewer .您能否检查您的web.config是否为ReportViewer注册了处理程序。 its should be like this它应该是这样的

Handler处理程序

<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>

Also check assembly section in your web.config for ReportViewer , it should be like below.还要检查您的web.config程序集部分是否为ReportViewer ,它应该如下所示。

<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
   <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

当我将应用程序池从集成更改为经典时,这个问题也消失了。

在我更改了我的查询调用的存储过程的参数而没有刷新 SSRS 设计器中的数据集后,我就出现了这个问题,所以你可以试试这个。

The last two days I have had the same issue.最近两天我遇到了同样的问题。 This is not really an answer to the original question - just some additional information for those having the same problem.这并不是对原始问题的真正答案 - 只是为遇到相同问题的人提供的一些附加信息。

The application I had the problem with has been developed in 2005 and is under development still.我遇到问题的应用程序是在 2005 年开发的,并且仍在开发中。

So it has been ported from VS 2005 to VS 2008 to VS 2010 and lately to VS 2013. It seems this is when the error happened.因此,它已从 VS 2005 移植到 VS 2008 到 VS 2010,最近又移植到 VS 2013。看来这是错误发生的时间。 Somewhere in between the .NET framework has switched from .NET 3.5 to .NET 4.介于 .NET 框架之间的某个地方已从 .NET 3.5 切换到 .NET 4。

I think (I did not verify) that with .NET 4 the report viewer *.dlls come as system libraries.我认为(我没有验证)在 .NET 4 中,报表查看器 *.dll 是作为系统库提供的。 Anyway this showed my GAC to me:无论如何,这向我展示了我的 GAC:

在此处输入图片说明

Only the first one, version 8, has been manually installed by myself (with the Reporting Viewer 2005 redistributable binary).我只手动安装了第一个版本 8(使用 Reporting Viewer 2005 可再发行二进制文件)。

So in VS 2013, Resharper is thinking of version 11 and automatically changes those lines in web.config所以在 VS 2013 中,Resharper 正在考虑版本 11 并自动更改 web.config 中的那些行

<httpHandlers>
  <!-- this is the correct one (if using Report Viewer 2005 / 8.0.0.0 -->
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>

<httpHandlers>
  <!-- this is the wrong one inserted during the update (or maybe Resharper) -->

  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>

So long story short: It seems - at least in my case - this error points to a version conflict with the libraries used with visual studio and those used an runtime.长话短说:似乎 - 至少在我的情况下 - 这个错误指向与 Visual Studio 使用的库和使用运行时的库的版本冲突。 The error given from Microsoft is a little bit misleading.微软给出的错误有点误导。

I don't have enough rep to comment on the existing answers, but the reason why may need to change your app pool from Integrated to Classic is because of this MSDN entry我没有足够的代表来评论现有的答案,但可能需要将您的应用程序池从集成更改为经典的原因是因为此 MSDN 条目

With an Integrated app pool you only need the handlers part, with a Classic app pool you need both handlers and httpHandlers.对于集成应用程序池,您只需要处理程序部分,对于经典应用程序池,您需要处理程序和 httpHandlers。

The same issue for me.对我来说同样的问题。 The issue also went away for me 1)when I changed the app pool from Integrated to Classic.这个问题对我来说也消失了 1) 当我将应用程序池从集成更改为经典时。 2) change HTTP handler like this 2)像这样更改HTTP处理程序

<httpHandlers>
 <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"   validate="false" />
    </httpHandlers>

我没有更改应用程序池中的任何内容,只是添加了这一行:

<Add name = "Reserved-ReportViewerWebControl-axd" path = "Reserved.ReportViewerWebControl.axd" verb = "*" type = "Microsoft.Reporting.WebForms.HttpHandler" resourceType = "Unspecified" />

We were getting this exact same error from the Report Viewer web control when we upgraded to SSRS 2016. But we also could not access the SSRS Web Portal - we were getting a 503 error which led us here: https://support.microsoft.com/en-gb/help/3171040/-http-503-service-unavailable-error-when-you-open-the-ssrs-web-portal-after-you-upgrade-to-ssrs-2016当我们升级到 SSRS 2016 时,我们从报告查看器 Web 控件中收到了完全相同的错误。但我们也无法访问 SSRS Web 门户 - 我们收到了 503 错误,导致我们来到这里: https : //support.microsoft。 com/en-gb/help/3171040/-http-503-service-unavailable-error-when-you-open-the-ssrs-web-portal-after-you-upgrade-to-ssrs-2016

Once we installed SQL Server 2016 Service Pack 1 everything worked.一旦我们安装了 SQL Server 2016 Service Pack 1,一切正常。

If you're using WCF Services for retrieving data form the database, you might face this issue even if you've added the HTTP handler to your web.config file.如果您使用 WCF 服务从数据库中检索数据,即使您已将 HTTP 处理程序添加到您的 web.config 文件,您也可能会遇到此问题。

In this case you also have to add the service endpoints, behaviors and bindings to the web.config to make things work.在这种情况下,您还必须将服务端点、行为和绑定添加到 web.config 以使其正常工作。

In my case, following line solved the problem for me :就我而言,以下行为我解决了问题:

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>
</system.webServer>

For IIS 7 or later对于 IIS 7 或更高版本

  <system.webServer>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>
  </system.webServer>

In my case, It was resolved by adding the below lines just next to <system.web> in the web.config在我的情况下,它是通过在 web.config 中的 <system.web> 旁边添加以下行来解决的

<system.webServer>
      <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </handlers>
</system.webServer>

The issue was I was using IIS 7 or above on my server.问题是我在我的服务器上使用 IIS 7 或更高版本。 The issue got resolved as I added this section to my code.当我将此部分添加到我的代码中时,问题得到了解决。

 <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
    <handlers>
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
    </handlers>
  </system.webServer>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM