ASP.NET HttpContext.Current.Session is suddenly always null

You have a problem with an ASP.NET MVC4 application where it worked fine and was pulling / pushing various objects in and out of the session.

After a problem with my machine, all of a sudden HttpContext.Current.Session always throws null reference exceptions whenever they were referenced.

This was not due to a code change, but obviously to my machine.

+3


source to share


1 answer


The problem was that after my machine crashed and restarted, the ASP.NET public service (Named aspnet_state) was no longer working. I went into windows services and started this service and the session started working correctly again.



It took me a while to find the answer to this question and I couldn't see it anywhere, so I thought it might be worth adding if it helps anyone.

+2


source







All Articles