locked
Problem with Application_Start event in global.asax RRS feed

  • Question

  • User542425706 posted

    Hi,

    Can anyone help me?

    I hava a Application_Start event in my global.asax file. For some reason it is not getting called when I run the application.

    void Application_Start(object sender, EventArgs e)

    {

    //Code that runs on application startup

    Response.Write("HttpContext.Current.Request.ServerVariables[HTTP_HOST] " + HttpContext.Current.Request.ServerVariables["HTTP_HOST"]);

    this event is not at all raising..

    any ideas..?

    thanks..

    Wednesday, April 30, 2008 9:23 AM

Answers

  • User1923880652 posted

    IT should only be get fired when you start you First time.

    There isn't any such event to be fire if you just build your application 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 2, 2008 12:13 PM

All replies

  • User1923880652 posted

    what is the type of your project website or web application?

    Have u put break point at the function?

    Try Change Application_Start to Application_OnStart

    Check http://forums.asp.net/p/980754/2072233.aspx

     

    U should also put a break point in Session_Start  event to check that is global.asax is working correctly or not

    Wednesday, April 30, 2008 9:59 AM
  • User542425706 posted

    Hi,

    I have change from Application_Start to Application_OnStart, but no use, still I am having the same problem.

    mine is a webapplication, I am using .net2.0.

    Wednesday, April 30, 2008 10:19 AM
  • User834890887 posted

     

    Hi, Are you using session mode "In proc"

    Since global.asax won't fire if you are using "Out of Proc"

    Wednesday, April 30, 2008 11:26 AM
  • User542425706 posted
    I am using In Proc mode.
    Wednesday, April 30, 2008 1:25 PM
  • User1923880652 posted
    Does session start function also fire or not?
    Wednesday, April 30, 2008 1:43 PM
  • User542425706 posted
    session start is getting fired. I don't know why the Application_OnStart is not firing every time. It should be fired everytime when I build the application. right? It's looking strange. it is getting fired very rarely.
    Friday, May 2, 2008 9:51 AM
  • User1672132137 posted

    Application_Start event will only fire when the application is first started. Now everytiime you run the application and because it was started it will not be executed unless it is removed from the AppDomain.

    for more information about Application_Start Event

    Friday, May 2, 2008 10:57 AM
  • User1923880652 posted

    IT should only be get fired when you start you First time.

    There isn't any such event to be fire if you just build your application 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 2, 2008 12:13 PM