Global constructor called twice

Discussion in 'ASP .Net' started by Manuel Vázquez Acosta, Jan 22, 2005.

  1. I found out that the constructor for the Global (Global.asax) component is
    called twice. The first time the Application_Start is called, while the
    second is not.
    Is this documented somewhere out there?

    So, any instance variable iniatilizated in the Application.Start, will be
    discarded the second time the Global constructor is called.

    Regards,
    Manuel.
    Manuel Vázquez Acosta, Jan 22, 2005
    #1
    1. Advertising

  2. > I found out that the constructor for the Global (Global.asax)
    > component is
    > called twice. The first time the Application_Start is called, while
    > the
    > second is not.
    > Is this documented somewhere out there?
    > So, any instance variable iniatilizated in the Application.Start, will
    > be discarded the second time the Global constructor is called.
    >
    > Regards,
    > Manuel.


    The first time is special (check reflector, they actually call it special).

    Generally speaking, they want you to do whatever you need to do in the application_start
    method.

    hth, Ryan
    Ryan Trudelle-Schwarz, Jan 22, 2005
    #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. Robert
    Replies:
    6
    Views:
    523
  2. TechCrazy
    Replies:
    5
    Views:
    395
    Karl Heinz Buchegger
    Jul 15, 2005
  3. Alexander Stippler

    conversion constructor called twice - why?

    Alexander Stippler, Oct 30, 2005, in forum: C++
    Replies:
    3
    Views:
    356
    Valentin Samko
    Oct 31, 2005
  4. Kiuhnm

    twice(twice(x))

    Kiuhnm, Apr 1, 2006, in forum: C++
    Replies:
    2
    Views:
    393
    Kiuhnm
    Apr 1, 2006
  5. Generic Usenet Account
    Replies:
    10
    Views:
    2,217
Loading...

Share This Page