简体   繁体   中英

HTTP Error 500.19 - Internal Server Error on ReportViewerWebControlHandler

I have been trying from past few days to run Report Viewer in my application but failed. The problem is that when I add

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

this handler in my web.config HTTP Error 500.19 - Internal Server Error on every page I try to access.

And if I remove it then it works fine but then the error occur on my reporting page

Report Viewer Configuration Error

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=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 

to the system.web/httpHandlers section of the web.config file, or add

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

to the system.webServer/handlers section for Internet Information Services 7 or later.

Please help me out of this problem

My whole web.config

<?xml version="1.0" encoding="utf-8"?>

<configuration>
  <connectionStrings>
 <add name="courierdbConnectionString" connectionString="Data Source=.\MSSQLSERVER2014;Initial Catalog=ushupk_courier;User ID= ushupk_ushupk;Password=Fahad123!@#" providerName="System.Data.SqlClient" />

  </connectionStrings>
  <system.web>
    <httpHandlers>
  <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
    </httpHandlers>
    <sessionState timeout="5400" />
    <compilation targetFramework="4.5">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
        <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
        <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </buildProviders>
    </compilation>
    <httpRuntime targetFramework="4.5" />
    <customErrors mode="Off" />
      </system.web>
      <system.webServer>
      <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
      <validation validateIntegratedModeConfiguration="false" />
    <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>
      <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <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>
      </runtime>
    </configuration>

Well, I can't offer an answer because I have what appears to be the same issue - I'm in the process of integrating some SSRS reports into new webpages of an existing webforms application using Microsoft.ReportViewer.WebForms. The changes run fine when running locally in debug mode, but as I was deploying to a VDEV box in preparation for another promotion to a System test environment, I made the addition in the web.config for the httphandler and that caused the 500 internal server error. When I comment that line back out or remove it from the web.config, the app works again (not the new SSRS reporting features though). I suspect that I have an issue somewhere in the web.config file as other developers in our org have successfully implemented similar solutions without the issue I see. We're on V 12 of the ReportViewer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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