Yup, its possible that the application_xxx events can be called more
than once, especially when IIS decides to recycle your webapp, but the
appDomains and therefor the static (shared) variables are seperated
from each other.
// Ryan
On 12/22/05, Mark Hurd <[EMAIL PROTECTED]> wrote:
> On 12/21/05,
On 12/21/05, Ryan Heath <[EMAIL PROTECTED]> wrote:
> 1) No that is not case. Each webapp has its own AppDomain.
But see the thread titled "ASP.NET: Application_Start getting called
twice" from the archives of this list (Nov 16 2005) where it is shown
there can be overlaps.
Regards,
Mark Hurd, B.S
d one choose for the tags? I only see disadvantages.
> 3) How do you guys manage global application variables?
>
> Piewie
>
> Original Message
> From: "David Lanouette" <[EMAIL PROTECTED]>
> To:
> Sent: Tuesday, December 20, 2005 6:58 PM
> Subjec
gs? I only see disadvantages.
3) How do you guys manage global application variables?
Piewie
Original Message
From: "David Lanouette" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, December 20, 2005 6:58 PM
Subject: Re: [ADVANCED-DOTNET] Global.asax: versus static
variables
>
I just wanted to add one more caviat (sp?) to what Ryan said.
For static variables, the runtime guarantees that only one instance is
created PER APP DOMAIN.
IIRC, If you have recycling configured in IIS6, that is done by
creating new App Domains. So, the object /could/ be recreated at any
time.
Threading problems are the same, your object should be context
agnostic and threadsafe.
Instance creation is different, with static variables, the runtime
guarantees that only one object is created. With application objects,
your own program must assure not to create more than one instance.
HTH
/
Hello,
I was used to specifiy global objects int the tag in a global.asa
file.
It is still possible to do so in the dotnet environment, but I think its a
pain to do so, because you need a lot of casts and the way you access those
global objects is rather verbose. Its something like
MyObjec