2015-04-30 33 views
0

我想在我的项目中添加一些报告,当我要告诉他们那个时候我得到了以下错误报表查看器配置错误的VS 2012和IIS 6.0

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

和我的网络配置文件看起来像以下: -

<system.web> 
<compilation debug="true" targetFramework="4.5"> 
    <assemblies> 
    <add assembly="System.Data.Entity, 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> 
</compilation> 
<httpRuntime targetFramework="4.5"/> 
<pages> 
    <namespaces> 
    <add namespace="System.Web.Optimization"/> 
    </namespaces> 
    <controls> 
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/> 
    </controls> 
</pages> 
<authentication mode="Forms"> 
    <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> 
</authentication> 
<profile defaultProvider="DefaultProfileProvider"> 
    <providers> 
    <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
    </providers> 
</profile> 
<membership defaultProvider="DefaultMembershipProvider"> 
    <providers> 
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> 
    </providers> 
</membership> 
<roleManager defaultProvider="DefaultRoleProvider"> 
    <providers> 
    <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
    </providers> 
</roleManager> 
<sessionState mode="InProc" timeout="20" customProvider="DefaultSessionProvider"> 
    <providers> 
    <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/> 
    </providers> 
</sessionState> 
</system.web> 

我没有看到任何“HttpHandlers的”部分在这里..我怎样才能从这个问题解决?之后添加“HttpHandlers的”部分manualy我仍然得到同样的错误

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

回答

1

在我的Web配置添加这部分,最后我从这个问题,通过以下方式达到: -

<system.webServer> <!-- Add this to here.... --> <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>