We have some logic for displaying custom error pages in our ASP.NET application through overriding Page.OnError. Now, when an error occurs within that error handling routine I can redirect somewhere else using the in web.config.
This works for most errors. Yet, I cannot find how to display a custom error page (or anything at all!) when getting e.g. a StackOverflowException. Obviously I cannot do any more processing insode ASP in such a case as practically anything will result in some allocation on the stack. The same is probably true for OutOfMemory, though I have not found any sensible way to test this. Is there any possibility I could still display something (possibly static) to the user, e.g. directly from IIS instead from ASP?