How far are "Shared" objects and properties shared?


H

HmFireBall

Hi,

This is a question about a shared property in ASP.NET

Imagine there's an assembly called my.dll that is in the /bin directory
of several websites.

This assembly contains a class with a shared property called
MySharedProp. Its value is initialized inside the shared constructor of
the class and should be based on values declared in the web.config of
each site. So the value of MySharedProp should be different from a site
to another.

My question is does it work? I mean : is MySharedProp shared by all the
objects of a site but different from a site to another (it's what I
assume) or even shared by all the sites that have the my.dll in their
/bin directory?

Sorry for my bad English and thank you if you can help me.

Henri
 
Ad

Advertisements

E

Eliyahu Goldin

Henri,

The scope for shared (static) members is an application. They are shared by
all user sessions for the same application but not across the applications.

Eliyahu
 
Ad

Advertisements

H

HmFireBall

Ok
What I assumed was correct then.
Thank you very much for your answer Eliyahu!

Henri

Eliyahu Goldin a écrit :
 

Top