Sorry that is does not help you immediately, but it can help you to approach the problem from the right side. First of all,
there is no such event as Application_Error
. This is supposed to be an event handler, a completely different thing. It is supposed to be added to the invocation list of an event using the "+=" operator, but how can we know if that operator was called or not?
So, use the debugger. Set a breakpoint on a very beginning of your event handler and another one on the line with "+=" operator. Write some application code to guarantee an exception. Make one step at a time.
Also, you are doing a big mistake by blocking propagation of exceptions by writing your try-catch block with empty catch block. This defeats the purpose of exception handling. Better remove your try-catch block at all. The purpose of structured exception handling mechanism is designed to avoid handling exceptions here and there. Normally, you need to catch all exceptions only on the top stack frame of the stack of each thread; and you might need to catch exceptions in few special cases, but blocking of the propagation is used very rarely (in particular, to work with some bad libraries which you cannot patch because source code is unavailable or if you cannot afford it).
If your search appears to be too complex, simplify the code to address only one isolated problem. In fact, instead of using your working code, create a minimal code sample to reproduce just one problem.
Please review these articles and see if you are missing something:
http://www.codeguru.com/csharp/.net/net_debugging/article.php/c19411/Web-Application-Error-Handling-in-ASPNET.htm[
^],
http://blogs.x2line.com/al/articles/2646.aspx[
^].
This is all I can advise based on your limited information.
Good luck,
—SA