How to protect application pools from session serialization exceptions?
We're using an Out-of-Process Session Provider ( ScaleOut ) for an ASP.NET application and we've noticed that when an object that's not correctly setup for de-serialization inadvertently makes its way into session it will eventually cause the entire process to terminate . Reproducing and handling this scenario is where it gets even more interesting. The exception that terminates the process is raised in AnyStaObjectsInSessionState whose implementation is pretty straightforward: internal static bool AnyStaObjectsInSessionState(HttpSessionState session) { if (session != null) { int count =