views:

33

answers:

1

What is difference when .NET assemblies are stored at shared location and GAC?

+1  A: 

Differences between placing assemblies in a shared single folder and placing them in the GAC:

  • Assemblies places in the GAC must be strongly typed
  • When loading assemblies the CLR will normally check in the GAC and load assemblies first, before considering other locations.
  • You can place multiple versions of the same assembly in the GAC (e.g. you can have both v1.0 and v2.0 of an assembly MyLibrary.dll side-by-side in the GAC)
  • The CLR knows the check in the GAC, whereas it won't know to check in your shared single folder without you first telling it where that folder is.

For more information on the GAC this article might be useful:

Using the GAC can solve many problems (including ones that you didn't even know you had). If you are considering attempting to store assemblies in some global assembly folder (or GAF for short), then I strongly recommend that you just use the GAC unless you have a really good reason not to.

Kragen
And how is it get handled in shared location?
Tanuja
If there are multiple web applications sharing a common assemblies, where those assemblies can be placed?Can we keep them at some shared location from where all these application can access or we need to keep them in GAC only?
Tanuja