Global constructor called twice

  • Thread starter Manuel Vázquez Acosta
  • Start date
M

Manuel Vázquez Acosta

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.
 
R

Ryan Trudelle-Schwarz

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
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top