I am getting a StackOverflowException on the highlighted line of code in the snippet below which is in Global.asax.cs, can someone please tell me why this could be happening?
Code:
public static HttpSessionState CurrentSession
{
get
{
if (HttpContext.Current == null)
return null;
return HttpContext.Current.Session;
}
}
Thanks,
Alex.
The answer was infact:
“Your stack overflow is not happening here. Maybe post the code that calls this — the code that is involved in the stack overflow (since you are probably calling this from a couple of places). – Eben Roux Jun 30 at 4:37”
It was occurring in the code that requests CurrentSession, but that is just the line it was breaking on.