HttpApplication Init, Application_Start and Application_End don't fire

Discussion in 'ASP .Net' started by Halcyon Woodward, Jul 14, 2003.

  1. I have an odd problem...

    We have a small development team (three coders) working on the same project
    (a C# web application). Each coder has a unique 'sandbox' site on a shared
    Windows 2003 where they can test the code they write. The majority of the
    code is written into a stand-alone class library shared via VSS, that is
    then referenced by each sandbox web (each of which is unique to each user).

    In the stand-alone class library, we have a class
    (PortalServices.Application) that subclasses or derives from
    System.Web.HttpApplication for common application-level event trapping.. In
    each sandbox web, the backend code for Global.asax is altered to derive from
    this custom class instead of HttpApplication. There are methods that
    override Init, and then the standard protected event handler methods.

    The first coder that we set up in this envrionment worked exactly as
    planned. However, the second coder has experienced a very odd problem. The
    Application_Start method fires once - when the web project is first created
    on the Windows 2003 server, after that - even if the server is rebooted -
    the Application_Start method never gets called again, and the Init and
    Application_End methods are _never_ called.

    It's driving us crazy. We need to have our sandbox sites on a Windows 2003
    server to test specific functionality that is unique to 2003, but we don't
    relish installing 2003 on each of our desktops as our workstation platform.

    Anybody have any ideas? Thanks in advance,

    hb.
    Halcyon Woodward, Jul 14, 2003
    #1
    1. Advertising

  2. Nevermind...

    The issue was related to security problems with the log we were writing to.

    D'oH!.



    "Halcyon Woodward" <> wrote in message
    news:...
    > I have an odd problem...
    >
    > We have a small development team (three coders) working on the same

    project
    > (a C# web application). Each coder has a unique 'sandbox' site on a

    shared
    > Windows 2003 where they can test the code they write. The majority of the
    > code is written into a stand-alone class library shared via VSS, that is
    > then referenced by each sandbox web (each of which is unique to each

    user).
    >
    > In the stand-alone class library, we have a class
    > (PortalServices.Application) that subclasses or derives from
    > System.Web.HttpApplication for common application-level event trapping..

    In
    > each sandbox web, the backend code for Global.asax is altered to derive

    from
    > this custom class instead of HttpApplication. There are methods that
    > override Init, and then the standard protected event handler methods.
    >
    > The first coder that we set up in this envrionment worked exactly as
    > planned. However, the second coder has experienced a very odd problem.

    The
    > Application_Start method fires once - when the web project is first

    created
    > on the Windows 2003 server, after that - even if the server is rebooted -
    > the Application_Start method never gets called again, and the Init and
    > Application_End methods are _never_ called.
    >
    > It's driving us crazy. We need to have our sandbox sites on a Windows

    2003
    > server to test specific functionality that is unique to 2003, but we don't
    > relish installing 2003 on each of our desktops as our workstation

    platform.
    >
    > Anybody have any ideas? Thanks in advance,
    >
    > hb.
    >
    >
    Halcyon Woodward, Jul 14, 2003
    #2
    1. Advertising

  3. Hello Halcyon,

    If you have time, could you please post more details on the solution of the problem and how you found it in order that all the
    community could benefit from it? Thanks very much for participating Microsoft newsgroup.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !From: "Halcyon Woodward" <>
    !References: <>
    !Subject: Re: HttpApplication Init, Application_Start and Application_End don't fire
    !Date: Mon, 14 Jul 2003 14:22:35 -0700
    !Lines: 52
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    !Message-ID: <>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !NNTP-Posting-Host: nausers.mccann.com 199.4.18.2
    !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:159050
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Nevermind...
    !
    !The issue was related to security problems with the log we were writing to.
    !
    !D'oH!.
    !
    !
    !
    !"Halcyon Woodward" <> wrote in message
    !news:...
    !> I have an odd problem...
    !>
    !> We have a small development team (three coders) working on the same
    !project
    !> (a C# web application). Each coder has a unique 'sandbox' site on a
    !shared
    !> Windows 2003 where they can test the code they write. The majority of the
    !> code is written into a stand-alone class library shared via VSS, that is
    !> then referenced by each sandbox web (each of which is unique to each
    !user).
    !>
    !> In the stand-alone class library, we have a class
    !> (PortalServices.Application) that subclasses or derives from
    !> System.Web.HttpApplication for common application-level event trapping..
    !In
    !> each sandbox web, the backend code for Global.asax is altered to derive
    !from
    !> this custom class instead of HttpApplication. There are methods that
    !> override Init, and then the standard protected event handler methods.
    !>
    !> The first coder that we set up in this envrionment worked exactly as
    !> planned. However, the second coder has experienced a very odd problem.
    !The
    !> Application_Start method fires once - when the web project is first
    !created
    !> on the Windows 2003 server, after that - even if the server is rebooted -
    !> the Application_Start method never gets called again, and the Init and
    !> Application_End methods are _never_ called.
    !>
    !> It's driving us crazy. We need to have our sandbox sites on a Windows
    !2003
    !> server to test specific functionality that is unique to 2003, but we don't
    !> relish installing 2003 on each of our desktops as our workstation
    !platform.
    !>
    !> Anybody have any ideas? Thanks in advance,
    !>
    !> hb.
    !>
    !>
    !
    !
    !
    Yan-Hong Huang[MSFT], Jul 16, 2003
    #3
  4. The problem turned out to be unrelated to the symptoms, as is often the case
    with most stumpers I've come across.

    We had a method in the Application class that would write entries to an XML
    log file, which we were using to record when each event fired. The same
    method was called to record whenever the Application_Error event fired.

    To make a long story short, we were having security problems with the
    logging method, the executing thread didn't always have permission to write
    to the XML file. Because the logging method was always called first in each
    event handling method, including Application_Error, no indication that an
    exception had been thrown ever bubbled up; producing the symptoms I
    described in my post.

    Cheers,

    hb.
    Halcyon Woodward, Jul 16, 2003
    #4
    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. Rashad Rivera

    Why does Application_Start fire twice?

    Rashad Rivera, Apr 26, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,583
    Matt Berther
    May 1, 2004
  2. Urs Eichmann

    Raising Exceptions in HttpApplication.Init

    Urs Eichmann, Feb 13, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,032
    Urs Eichmann
    Feb 13, 2006
  3. Tony Cheng
    Replies:
    1
    Views:
    8,187
    Juan T. Llibre
    Feb 24, 2006
  4. Christian Blackburn
    Replies:
    7
    Views:
    956
    Mark Rae
    Jun 16, 2006
  5. Jess
    Replies:
    4
    Views:
    430
Loading...

Share This Page