I always use Global.asax for centralized error handling in my ASP.Net applications and typically it works great.
The other day though, I ran into a very strange issue: While running local, everything works fine (the error page shows up via a Server.Transfer within Application_Error). But once deployed, the custom error page no longer seemed to work, and the standard error page showed up.
I was quite perplexed as to why this happened. And a quick search using Google I found out that it seemed that quite a few people out there were experiencing the same issue. The server is running Windows 2003 and has both Framework 1.1 and 2.0 (the application is in 2.0).
As what I am doing within Application_Error does not require any special privilege (only saves the error in session and does a server transfer) so I am pretty sure that this could not have been a permission issue. Anyway, an aspnet_regiis /u and /i seemed to have fixed the issue. But the strangest thing is that nothing seems to have changed…
Well, I am still not sure what the exact cause was, and I will definitely come back to it if I ever find out…