0
votes

Here are the both exception and the inner exception messages plus stack trace. This is works really fine when I run with visual studio. I have used ReportViewerForMvc and installed via Nuget. So I do have all the .dll referenced. Only issue is it is not working once I hosted with unoeuro.

Exception of type 'System.Web.HttpUnhandledException' was thrown.

at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.reportviewerwebform_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) An error occurred during local report processing.

at Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WebForms.LocalReport.GetParameters() at ReportViewerForMvc.ReportViewerExtensions.SetProperties(LocalReport localReport, LocalReport properties) at ReportViewerForMvc.ReportViewerExtensions.SetProperties(ReportViewer reportViewer, ReportViewer properties) at ReportViewerForMvc.ReportViewerWebForm.BuildReportViewer() at ReportViewerForMvc.ReportViewerWebForm.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Please help me to solve this. I have already gone through many threads but couldn't find a solution

1
Possible that the RDLC Report File was not properly deployed to target environment, or doesn't reside in the expected folder (relative paths) when the executing directory changesthmshd
Bingo !!! I forgot to check that. Yes that was the issue. Put it as the answer. I will accept !!! How to make it always publish ? Can I achieve it by making Copy to Output Directory - Copy always ?Peck_conyon
added my answer, with MSDeploy based deployment, I think Copy if newer is sufficient in our casethmshd

1 Answers

1
votes

Without really knowing what the cause is, I can guess what it could be. It's possible that the RDLC Report File (e.g. MyReport.rdlc) was not properly deployed to target environment, or doesn't reside in the expected folder (relative paths) when the executing directory changes.

In Visual Studio, ensure that Copy to Output Directory Property is set to Copy if newer/always, and when executing on IIS, the Files could appear within \bin directory, while locally, they're probably within bin\Debug.

When passing in the File name of MyReport.rdlc, in our application, we make it configurable and construct the path like this:

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

In the web.config file, add the Path setting:

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

You can override the setting for every environment to match the target structure.