共享主机

时间:2017-09-20 14:13:30

标签: c# asp.net .net reportviewer report-viewer2012

我开发了ASP.NET应用程序,它需要ReportViewer才能实现功能。我的网站在localhost上工作得非常好。我的共享托管服务提供商要求我将ReportViewer版本从11升级到12,我在本地主机上工作正常。但在共享主机空间我得到以下错误: ReportViewer配置错误

  

报表查看器Web控件HTTP处理程序尚未在应用程序的web.config文件中注册。添加到web.config文件的system.web / httpHandlers部分,或添加到Internet Information Services 7或更高版本的system.webServer / handlers部分。

我的Web.Config文件

<configuration>
  <system.web>
    <customErrors mode="Off"/>
    <httpHandlers>
      <!--<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=000000000000" validate="false"/>-->
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000" validate="false"/>   

      </httpHandlers>
    <compilation targetFramework="4.5">
      <assemblies>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>
        <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>
        <add assembly="Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>

      </assemblies>
      <buildProviders>
        <!--<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>-->
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>
      </buildProviders>
    </compilation>
    <httpRuntime targetFramework="4.5"/>
    <!--<sessionState timeout="1" />-->
    <authentication mode="Forms">
      <forms loginUrl="login.aspx" timeout="40" slidingExpiration="true"/>
    </authentication>
    <!--<sessionState timeout="20"></sessionState>-->
  </system.web>
  <!--<authentication mode="Forms">
      <forms loginUrl="CompanyMaster.aspx" />
    </authentication>-->

  <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=11.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>-->
    <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=000000000000"/>
    </handlers>
    <!--<defaultDocument>
    <files>
      <clear />
      <add value="Login.aspx" />
    </files>
  </defaultDocument>-->
  </system.webServer>
  <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
  </appSettings>
</configuration>

我还在BIN文件夹中添加了所有3个DLL文件

任何人都可以指导我错在哪里吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

问题终于解决了!

我将IIS应用程序池从Integrated更改为 Classic 。它现在运作得很好!