application_error isn't thrown

Discussion in 'ASP .Net' started by Mark Heimonen, Nov 17, 2003.

  1. 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
    Mark Heimonen, Nov 17, 2003
    #1
    1. Advertising

  2. Does anybody have any ideas on why this might happen. My application is
    using WilsonWebCompile (http://dotnetinfowire.com/news.asp?nid=325) to force
    the site to stay alive.

    "Mark Heimonen" <> wrote in message
    news:...
    > 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
    >
    >
    Mark Heimonen, Nov 18, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ma_news

    Application_Error event

    ma_news, Jun 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    689
    ma_news
    Jun 17, 2004
  2. twahl
    Replies:
    2
    Views:
    618
    Tian Min Huang
    Jun 30, 2003
  3. Stoyan
    Replies:
    0
    Views:
    466
    Stoyan
    Jul 10, 2003
  4. Phil Johnson
    Replies:
    2
    Views:
    1,211
    Phil Johnson
    Mar 7, 2008
  5. Author
    Replies:
    1
    Views:
    515
    George
    Sep 24, 2008
Loading...

Share This Page