----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: SitaramanM Message 3 in Discussion Hi Sovon/Akshit Whereas Instance variable are per instance, Static variables are per type. So you will have one instance of the variable associated with the type , irrelevant of the number of instances of that class That said, the scope/relevance of the Static entity will be limited to the appdomain in which your code is executing. As per ECMA-334 C# Language Specification, each application domain has its own copy of static variables for these types, and a static constructor(.cctor function present in the IL) for a type is run at most once per application domain. So if i start two applications in 2 different appdomains, then there will be 2 instances of the Static Variables. However, if at the initial stage itself, i start my own appdomain and inside that i load multiple applications, then all these apps should share that static variable So, IMO, Static variables scope and relevance should be seen from the perspective of the appdomain rather than the application itself. The fact that " the process of the CLR Hosting, Default Appdomain Creation etc are done behind-the scenes" tend to obscure the fact that it is the appdomain is the important entity to be taken into consideration in this situation. hth regards, sr ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/BDotNet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
