2017-11-21 1 views
0

여기에는 예외 및 내부 예외 메시지와 스택 추적이 모두 있습니다. 이것은 Visual Studio로 실행할 때 정말 잘 작동합니다. 나는 ReportViewerForMvc을 사용했으며 Nuget을 통해 설치했습니다. 그래서 나는 모든 .dll을 참조해야합니다. 내가 어휴와 함께 접대하면 문제가되지 않는다.MVC 5 응용 RDLC 보고서는 호스팅 후 예외를 throw하지만 Visual Studio에서 정상적으로 작동합니다.

'System.Web.HttpUnhandledException'유형의 예외가 발생했습니다.

System.Web.UI.Page.ProcessRequest에서 System.Web.UI.Page.ProcessRequestMain (부울 includeStagesBeforeAsyncPoint 부울 includeStagesAfterAsyncPoint)
에서 System.Web.UI.Page.HandleError (예외 E)에서

(부울 includeStagesBeforeAsyncPoint 부울 includeStagesAfterAsyncPoint) System.Web.UI.Page.ProcessRequestWithNoAssert (HttpContext를 컨텍스트)에 System.Web.UI.Page.ProcessRequest()에서
System.Web.UI.Page.ProcessRequest에서
(HttpContext를 context) at ASP.reportviewerwebform_aspx.ProcessRequest (HttpContext context) at,System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()에서 System.Web.HttpApplication.ExecuteStep 때 (IExecutionStep 단계, 부울 & completedSynchronously) 오류가 로컬 보고서를 처리하는 동안 일어났다. Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession에서

() ReportViewerForMvc에서 ReportViewerForMvc.ReportViewerExtensions.SetProperties (LocalReport localReport, LocalReport 특성)에 Microsoft.Reporting.WebForms.LocalReport.GetParameters()에서
. ReportViewerForMvc.ReportViewerWebForm.Page_Load에서 ReportViewerForMvc.ReportViewerWebForm.BuildReportViewer()에서 ReportViewerExtensions.SetProperties (의 ReportViewer 의 ReportViewer,의 ReportViewer 속성) (개체 보낸 사람, 있는 EventArgs e)에 System.Web.Util.CalliEventHandlerDel에서 System.Web.UI.Control.OnLoad (EventArgs e)의 에서 System.Control.Callback 이 문제를 해결하기 위해 부울 includeStagesBeforeAsyncPoint, 부울 includeStagesAfterAsyncPoint)

저를 도와주세요. 이미 많은 스레드를 통과했지만, 나는 그것이 할 수있는 것을 추측 할 수 진짜 원인 무엇인지 모른 채 해결책

+0

실행 디렉터리가 변경 될 때 RDLC 보고서 파일이 대상 환경에 제대로 배포되지 않았거나 예상되는 폴더 (상대 경로)에 있지 않을 수 있습니다. – thmshd

+0

빙고 !!! 나는 그걸 잊어 버렸다. 네, 그게 문제였습니다. 대답으로 답하십시오. 나는 받아 들일 것이다 !!! 항상 게시하도록하는 방법? 출력 디렉토리로 복사 - 항상 복사를 사용하여이 작업을 수행 할 수 있습니까? –

+0

은 MSDeploy 기반 배포로 내 대답을 추가했습니다. 우리의 경우에는'Copy if newer'로 충분하다고 생각합니다. – thmshd

답변

1

를 찾을 수 없습니다. RDLC 보고서 파일 (예 : MyReport.rdlc)이 대상 환경에 제대로 배포되지 않았거나 실행중인 디렉토리가 변경 될 때 예상되는 폴더 (상대 경로)에 상주하지 않을 수 있습니다.

은 Visual Studio에서, Copy to Output Directory 속성이 Copy if newer/always로 설정되어 있는지 확인하고, IIS에서 실행하면 로컬로, 그들은 bin\Debug 내에서 아마있는 동안, 파일은 \bin 디렉토리에 표시 될 수 있습니다.

우리의 응용 프로그램에서, MyReport.rdlc의 파일 이름을 전달 , 우리는 그것을 구성하고이 같은 경로 구성 : 경로 설정의 web.config 파일에서

var rdlcFullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["ReportingPath"], "MyReport.rdlc"); 

을 추가

<add key="ReportingPath" value="bin\Reports" /> 

모든 환경에 대한 설정을 대상 구조와 일치하도록 재정의 할 수 있습니다.

관련 문제