Is a static variable in a library (DLL) shared by all processes referencing that library?

后端 未结 1 1942
独厮守ぢ
独厮守ぢ 2020-12-14 17:07

I know that a static variable used in a web application is shared for all users across the web application. If I have a library (DLL) that uses some static private variable,

1条回答
  •  伪装坚强ぢ
    2020-12-14 17:50

    No they won't. They are loaded in separate AppDomains and cannot see each other's instances.

    Even if they refer to same physical file, each application gets its own private instance of the assembly.

    0 讨论(0)
提交回复
热议问题