Application_Start not firing in global.asax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max

    #1

    Application_Start not firing in global.asax

    I've noticed some procedures don't run in the global.asax when you'd expect
    them to. I've rebuilt and set break points, but Application_Sta rt just isn't
    firing today. Is there some configuration that prevents this from happening?

    I've never gotten Session_End to fire either.

    -M


  • Steve C. Orr [MVP, MCSD]

    #2
    Re: Application_Sta rt not firing in global.asax

    Well I don't know when "you'd expect" the Application_Sta rt event to fire,
    but I know I don't expect it to happen very often. Under normal release
    conditions it should normally pretty much only fire after you reboot the
    server and someone requests the first page.
    The session will time out after 20 minutes of no page requests from the
    user.
    This default time interval is configurable in your web.config file.
    After the session times out the Session_End event will be called in your
    Global.asax file.
    You can terminate the session manually by calling Session.Abandon , but be
    aware this will cause the Session_End event to not be called. But that's
    not so bad. Just take your code from the Session_End event, put it in a
    separate function, then call that function from both your Session_End event
    and whenever you call Session.Abandon . The Session_End event also won't
    fire when you hit the stop button in the VS.NET IDE. It also won't fire at
    all if you're not using standard in proc sessions.

    Here's more details for you:
    Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP

    Hire top-notch developers at http://www.able-consulting.com



    "Max" <maximus@portvi sta.com> wrote in message
    news:R0ejb.1144 92$eS5.60668@tw ister.tampabay. rr.com...[color=blue]
    > I've noticed some procedures don't run in the global.asax when you'd[/color]
    expect[color=blue]
    > them to. I've rebuilt and set break points, but Application_Sta rt just[/color]
    isn't[color=blue]
    > firing today. Is there some configuration that prevents this from[/color]
    happening?[color=blue]
    >
    > I've never gotten Session_End to fire either.
    >
    > -M
    >
    >[/color]


    Comment

    • Max

      #3
      Re: Application_Sta rt not firing in global.asax

      I understand all that very well as I've been working on this problem for 3
      months now. I've never been able to get Session_End to fire neither on the
      remote server or my local machine. But just recently I've noticed nothing in
      the global.asax is firing on my local machine and cookieless mode does not
      work either. I suspect the cookie problem has to do with my application not
      being in the root of my IIS, as it works fine on the remote.

      Any direction you could point me too would be helpful.

      -M



      "Steve C. Orr [MVP, MCSD]" <Steve@Orr.ne t> wrote in message
      news:eiM5YI0kDH A.2772@TK2MSFTN GP10.phx.gbl...[color=blue]
      > Well I don't know when "you'd expect" the Application_Sta rt event to fire,
      > but I know I don't expect it to happen very often. Under normal release
      > conditions it should normally pretty much only fire after you reboot the
      > server and someone requests the first page.
      > The session will time out after 20 minutes of no page requests from the
      > user.[/color]


      Comment

      • Alvin Bruney

        #4
        Re: Application_Sta rt not firing in global.asax

        Congratulations on those shiney new letters in your name. It is well
        deserved. Keep up the good work.

        "Steve C. Orr [MVP, MCSD]" <Steve@Orr.ne t> wrote in message
        news:eiM5YI0kDH A.2772@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Well I don't know when "you'd expect" the Application_Sta rt event to fire,
        > but I know I don't expect it to happen very often. Under normal release
        > conditions it should normally pretty much only fire after you reboot the
        > server and someone requests the first page.
        > The session will time out after 20 minutes of no page requests from the
        > user.
        > This default time interval is configurable in your web.config file.
        > After the session times out the Session_End event will be called in your
        > Global.asax file.
        > You can terminate the session manually by calling Session.Abandon , but be
        > aware this will cause the Session_End event to not be called. But that's
        > not so bad. Just take your code from the Session_End event, put it in a
        > separate function, then call that function from both your Session_End[/color]
        event[color=blue]
        > and whenever you call Session.Abandon . The Session_End event also won't
        > fire when you hit the stop button in the VS.NET IDE. It also won't fire[/color]
        at[color=blue]
        > all if you're not using standard in proc sessions.
        >
        > Here's more details for you:
        > http://www.asp.net/Forums/ShowPost.a...=1&PostID=7504
        >
        > --
        > I hope this helps,
        > Steve C. Orr, MCSD, MVP
        > http://Steve.Orr.net
        > Hire top-notch developers at http://www.able-consulting.com
        >
        >
        >
        > "Max" <maximus@portvi sta.com> wrote in message
        > news:R0ejb.1144 92$eS5.60668@tw ister.tampabay. rr.com...[color=green]
        > > I've noticed some procedures don't run in the global.asax when you'd[/color]
        > expect[color=green]
        > > them to. I've rebuilt and set break points, but Application_Sta rt just[/color]
        > isn't[color=green]
        > > firing today. Is there some configuration that prevents this from[/color]
        > happening?[color=green]
        > >
        > > I've never gotten Session_End to fire either.
        > >
        > > -M
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Max

          #5
          Re: Application_Sta rt not firing in global.asax

          Ok, I found my solution. All subs now work on my global.asax FINALLY !!!!

          I simply renamed the global.asax file and added a new one to the project. It
          now runs fine.

          Now since I don't believe in VS.NET's MYSTERY CODE, I decided to compare the
          old global files with the new global files to see what the problem was, but
          found them to be completely identical! Have any explanation for that Mr. MVP
          ?? LOL!

          Seriously, I would like to know how the global.asax screws up like this...
          it seems like a very common problem. Deleting and adding a new gloabal.asax
          is not in any of the articles I've read. It must just not compile for some
          reason. resx was all in there...

          -M


          "Steve C. Orr [MVP, MCSD]" <Steve@Orr.ne t> wrote in message
          news:eiM5YI0kDH A.2772@TK2MSFTN GP10.phx.gbl...[color=blue]
          > Well I don't know when "you'd expect" the Application_Sta rt event to fire,
          > but I know I don't expect it to happen very often. Under normal release
          > conditions it should normally pretty much only fire after you reboot the
          > server and someone requests the first page.
          > The session will time out after 20 minutes of no page requests from the
          > user.
          > ...
          >
          > Here's more details for you:
          > http://www.asp.net/Forums/ShowPost.a...=1&PostID=7504
          >
          > --
          > I hope this helps,
          > Steve C. Orr, MCSD, MVP
          > http://Steve.Orr.net
          > Hire top-notch developers at http://www.able-consulting.com
          >[/color]


          Comment

          Working...