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
 
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
 
H

HmFireBall

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

Henri

Eliyahu Goldin a écrit :
 

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

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top