Handling Joins in GAC Assemblies

I know that when creating a DLL and declaring the items as "Shared" (Static in C #) they are created the first time they are called, and then that object reference lives as the only reference.

Thus, by declaring that the shared property as a string after set can be called again to get the same value. And this thread safety is a major application concern.

What happens outside of the application domain. If we put the assembly in the global application cache (GAC), how many instances will exist?

For example, a static property called "MyFileName" in GAC'ed.dll.

Then we have two applications calling GAC'ed.dll. How many instances of "MyFileName" will exist? Did you change MyFileName from application one copy to the value that application two uses?

0


source to share


1 answer


The DLL is created in the AppDomain, so there are as many different copies as there are AppDomains. No data is transferred between AppDomains. Putting the DLL in the GAC just makes it available to everything in one place, it doesn't change the .net memory model.



+2


source







All Articles