Application_error event not firing after publishing

Discussion in '.NET' started by KhD, Jul 21, 2011.

  1. KhD

    KhD

    Joined:
    Jul 21, 2011
    Messages:
    2
    Likes Received:
    0
    I know this has been asked a lot of times, but I could not get things working from those posts.

    I have implemented Application_error method in Global.asax file to log and send email for all unhandled exceptions. This works perfectly fine when running on Visual Studio, but as soon as I publish it to the test server, the Application_event stops firing. No log entry is made to the text file and no email is sent.

    PrecompiledApp.config file is present in the root directory, along with App_global.asax.compiled, App_global.asax.dll in the bin folder. Global.asax file is not present after I publish the website.

    I have tried removing PrecompiledApp.config file, but it doesn't work. I have tried adding Global.asax file to the root directory, but doesn't work. I have tried with

    Code (Text):
    <customErrors mode="Off"  />
    and

    Code (Text):
    <customErrors mode="On" defaultRedirect="Error Page.aspx" />
    in web.config file....nothing works.

    I added a line to Page_load of a page:

    Code (Text):
    Response.Write("<br/>ApplicationInstance: " +  Context.ApplicationInstance.GetType().FullName);
    It returns ApplicationInstance: ASP.global_asax, which should be returned according to a post. Then why is the event not firing?

    Please Help!!!

    Thanks!!!
     
    KhD, Jul 21, 2011
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Ken Dopierala Jr.

    Application_Error not firing in Release Mode.

    Ken Dopierala Jr., Dec 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,342
    Kumar Reddi
    Dec 3, 2004
  2. =?Utf-8?B?ZGFuYw==?=

    DataGrid ItemCommand event not firing if not first page

    =?Utf-8?B?ZGFuYw==?=, Oct 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,477
    =?Utf-8?B?ZGFuYw==?=
    Oct 26, 2005
  3. cesporma@Hotmail.com
    Replies:
    0
    Views:
    875
    cesporma@Hotmail.com
    Mar 29, 2006
  4. Brian
    Replies:
    0
    Views:
    2,683
    Brian
    Jul 21, 2006
  5. jobs
    Replies:
    1
    Views:
    1,813
    Juan T. Llibre
    Nov 15, 2007
  6. Anthony Papillion

    TkInter bind() event is not firing event trigger

    Anthony Papillion, Jun 23, 2010, in forum: Python
    Replies:
    3
    Views:
    2,332
    rantingrick
    Jun 23, 2010
  7. kolekar_prashant
    Replies:
    0
    Views:
    1,120
    kolekar_prashant
    Apr 25, 2011
  8. Jim
    Replies:
    2
    Views:
    372
Loading...