2011-11-21 30 views
11

報告的部署和工作,在報表管理器驗證。報表查看器Web控制10版提供錯誤儘管正確設置

我的應用程序是一種MVC2應用程序與我自己的aspx頁面上的報告。此頁面與報表查看器控件的第8版一起工作,但我們轉移到了新服務器,升級了sql server,並且正在嘗試更新我們的網站以匹配。

的服務器的Windows Server 2008與IIS 7.5。

我測試在Chrome和IE 9

儘管我盡了最大努力,我仍然得到這個錯誤:

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=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 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=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.webServer/handlers section for Internet Information Services 7 or later.

但是,我已經做到了這一點。事實上,我甚至MSDN閱讀:

To use IIS 7.0 in Integrated mode, you must remove the HTTP handler in system.web/httpHandlers. Otherwise, IIS will not run the application, but will display an error message instead.

爲了安全起見,我想既不而直接添加處理程序到IIS,只是在我的配置Web服務器的HTTP處理程序,只是HTTP處理程序的組合在我的配置,和兩者。

讓我們從我的web.config

<configuration 
    <system.web> 
    <httpRuntime maxQueryStringLength="4096" /> 
    <compilation targetFramework="4.0"> 
     <assemblies> 
     <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
     <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
     <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
     <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" /> 
     </assemblies> 
     <buildProviders> 
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
     </buildProviders> 
    </compilation> 
    </system.web> 
    <system.webServer> 
    <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> 
    </system.webServer> 
</configuration> 

開始我有組件,構建商和處理程序。還有什麼可能是錯的?

回答

6

我發現了一個快速和骯髒的解決辦法 - 你的web配置補充一點:

<location path="Reserved.ReportViewerWebControl.axd"> 
<system.web> 
    <authorization> 
    <allow users="*" /> 
    </authorization> 
</system.web> 

我小提琴手看到,由於某些原因,當頁面請求,而不是讓HTTP Reserved.ReportViewerWebControl.axd 200響應服務器將發送302-移動到login.aspx?returnurl =「Reserved.ReportViewerWebControl.axd。因此,允許所有用戶到處理程序路徑解決問題。

+0

我是喬希將確認此作品:)謝謝 –

+0

在這種情況下,你可以請答覆標記爲接受? – lstanczyk

+0

錯過了一個關鍵詞...我希望喬什會證實這個作品! :) –

1

我認爲它的IIS7上的ReportViewer呈現問題 我有手動映射我的ReportViewer手柄IIS7這樣的:

•打開Internet信息服務(IIS)管理器並選擇您的Web應用程序。

•在IIS區域,在處理程序映射圖標,雙擊。

•站在你右邊的操作窗格中,單擊添加託管處理程序。

•在託管處理程序對話框中添加,輸入以下命令:

請求路徑:Reserved.ReportViewerWebControl.axd

類型:Microsoft.Reporting.WebForms.HttpHandler

名稱:保留-ReportViewerWebControl -axd

•單擊確定。

也加入


還是我的工作不改變由web配置。我認爲上述解決方案可以幫助其他人。

+0

是的,這個修復了我(IIS7,Server 2008) – odinel

-1

我試圖通過從asp.net項目中刪除不需要的mvc程序集。因此,簡單的解決方案是從Web項目的Bin文件夾中刪除WebMatrix。* .dll,因爲它屬於mvc框架。

相關問題