application_error isn't thrown

M

Mark Heimonen

Hi,

I've been using a standard global error handling page for almost two years.
I posted a new revision of code on the site on Friday, and my global error
handling routine quit working. The application_error event in
global.asax.vb just quit being called. Instead, I see the default ASPX
error message. I found that if I copy over one of the .dlls from the dev
site, the error handling starts working properly again. After a while, it
quits working again, and I have to re-copy over a .dll to get it working.

There is one other problem that seems to be related. My application
involves sending out a fair bit of email notification through the default
mail server. The global error handling routine emails a copy of the error
message. It seems that the error handling routine, and all email
notifications throughout quit working at the same time.

Recently, I had some problems with emails being stuck in the
c:\inetpub\mailroot\badmail folder, but I have taken care of those problems
by setting the server to allow relaying from 127.0.0.1. I checked, and
there are no messages stuck in the inetpub\mailroot folders. I've also had
problems with the statement smptMail.smptserver = "blah". That statement
seems to work on some servers, but not others. I have recently switched to
SmptMail.SmptServer.Insert(0,"blah"), which seems to work properly.

The last section of my global error handling routine looks like this:

MyMessage.Body = MyMessage.Body & "<p><b>Last Error
Message:</b>" & Replace(Server.GetLastError().Message(), Chr(13), "<br/>")
MyMessage.Body = MyMessage.Body & "<p><b>Last Error
Source:</b>" & Replace(Server.GetLastError().Source(), Chr(13), "<br/>")
SmtpMail.SmtpServer.Insert(0,
System.Configuration.ConfigurationSettings.AppSettings("mailServer"))
SmtpMail.Send(MyMessage)

Server.ClearError()

Response.Clear()

Response.Redirect(System.Configuration.ConfigurationSettings.AppSettings("ap
pPath") & "ErrorDisplay.aspx")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top