Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Global constructor called twice

Reply
Thread Tools

Global constructor called twice

 
 
Manuel Vázquez Acosta
Guest
Posts: n/a
 
      01-22-2005
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.


 
Reply With Quote
 
 
 
 
Ryan Trudelle-Schwarz
Guest
Posts: n/a
 
      01-22-2005
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A constructor calling another constructor (default constructor)? Generic Usenet Account C++ 10 11-28-2007 04:12 AM
FWSM/PIX and Dynamic PAT using global IP range vs. global interface vs. global IP Hoffa Cisco 0 10-25-2006 01:04 PM
conversion constructor called twice - why? Alexander Stippler C++ 3 10-31-2005 08:18 AM
Why is copy constructor called only twice here (should be thrice?) TechCrazy C++ 5 07-15-2005 10:15 AM
Why is the Base class Constructor getting called twice Robert C++ 6 12-11-2003 12:06 PM



Advertisments