How far are "Shared" objects and properties shared?

Discussion in 'ASP .Net' started by HmFireBall, Jan 2, 2006.

  1. HmFireBall

    HmFireBall Guest

    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
    HmFireBall, Jan 2, 2006
    #1
    1. Advertising

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

    "HmFireBall" <> wrote in message
    news:...
    > 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
    Eliyahu Goldin, Jan 2, 2006
    #2
    1. Advertising

  3. HmFireBall

    HmFireBall Guest

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

    Henri

    Eliyahu Goldin a écrit :
    > 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
    >
    > "HmFireBall" <> wrote in message
    > news:...
    >
    >>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

    >
    >
    >
    HmFireBall, Jan 2, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Simper
    Replies:
    5
    Views:
    2,814
    Andrea Desole
    Jan 19, 2005
  2. Victor Porton
    Replies:
    1
    Views:
    696
    Steven T. Hatton
    Aug 29, 2004
  3. Andy Dingley
    Replies:
    45
    Views:
    1,647
    Andy Mabbett
    Jun 11, 2006
  4. 7stud
    Replies:
    11
    Views:
    684
    Dennis Lee Bieber
    Mar 20, 2007
  5. RC
    Replies:
    2
    Views:
    439
    Chase Preuninger
    Jan 8, 2008
Loading...

Share This Page