views:

47

answers:

3

Hi, I am getting "ASP.NET session has expired" error when viewing a (SQL server reporting services) report using report viewer control. sometimes it works fine and sometimes I get this error, it works fine in Dev, but not in test environment. Please let me know if you have any clues. thanks in advance. here is the code for the report viewer control.

ReportViewer1.ServerReport.ReportServerUrl = new Uri(System.Configuration.ConfigurationManager.AppSettings["ReportServerUrl"]);

    ReportViewer1.ServerReport.ReportPath = System.Configuration.ConfigurationManager.AppSettings["ReportPath"];
    ReportViewer1.ServerReport.SetParameters(new List<ReportParameter> { new ReportParameter("key", "value") });
    ReportViewer1.DataBind();
A: 

Hi RKP, Take a look at the application pool in iis, check the advanced settings->process model->idle timeout (minutes). Set this higher than 20 mins. Sounds like the worker process is shutting down because its idle. Often this happens with test systems because they don't get that many hits to stop the idle timeout from kicking in.

Cheers Tigger

Tigger
A: 

I had a problem with these symptoms for months on a production server and was never able to reproduce it reliably on any development or test server. I was going nuts, until some quirky configuration change finally made ASP.NET log a new warning whenever this session expired error occurred.

Long story short, my problem was a bug in Report Viewer. It's been bugged on Connect and I added a workaround to the case which may help you:

https://connect.microsoft.com/VisualStudio/feedback/details/556989/

Before doing any drastic workarounds, first check Event Viewer on the test server and look for an ASP.NET warning event around the time you hit this error. See if the event makes mention of the 'IterationId' parameter.

Stefan Mohr
A: 

I fixed it by setting AsyncRendering to false for the report viewer control. just a temporary workaround until I find a proper solution.

RKP