Why is HttpContext.Current sometimes null when using ASP.NET ReportViewer?

SPUNGEBOB827

New Member
In our ASP.NET Web Application, we have a service with a life-time/scope that can described as "instance per request" i.e. the instance is stored in the \[code\]HttpContext.Current.Items\[/code\] collection.We have had this intermittent issue where the \[code\]HttpContext.Current\[/code\] property is \[code\]null\[/code\] during calls from the ASP.NET \[code\]ReportViewer\[/code\] control. Sometimes it is \[code\]null\[/code\], sometimes it is not. The behaviour can be different on the staging website versus a dev machine, and even varies between different dev machines. This will cause a report which would like to use our service to throw an exception.Why is the \[code\]HttpContext.Current\[/code\] property \[code\]null\[/code\]?Why is it intermittent?
 
Back
Top