Is the GAC dynamic?

J

julien

Hello,
I have one 2 more questions about the GAC:
1/If I had a dll to be shared in the GAC directory, will it be loaded
when a program will try to find it? Or do I have to load it manually
using the command line tool?
2/If I change the config file to change the version mapping, will it be
automatically reflected by the GAC, or do I have to manually unload all
libraries and load them back?

Thank you
Julien
 
C

Carlos J. Quintero [.NET MVP]

julien said:
Hello,
I have one 2 more questions about the GAC:
1/If I had a dll to be shared in the GAC directory, will it be loaded when
a program will try to find it?

When an app needs a DLL, the .NET framework run-time will load it wherever
is found.
Or do I have to load it manually using the command line tool?

Huh? What command-line tool? The gacutil.exe command-line tool only puts
DLLs in the GAC. Once there, apps can use them.
2/If I change the config file to change the version mapping, will it be
automatically reflected by the GAC, or do I have to manually unload all
libraries and load them back?

If you change the config file, changes will be taking into account the next
time that you run the app. There is no reflection or change in the GAC: the
GAC will have 2 versions of the DLL and your config file sets what version
to use.

So, no the GAC is not dynamic. The GAC is a kind of static repository for
versioned DLLs, and apps, when run, decide which version to use.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
D

Dan Bass

I'd recommend reading up on this more...

http://msdn.microsoft.com/library/d...nWorkingWithAssembliesGlobalAssemblyCache.asp


The GAC registers an assembly, and I believe is loaded when your application
loads it. If more than one application loads it simultaneously, it is loaded
once, but then each additional assembly reference has an image created in
the GAC.

Finally, the versioning and strong named nature of assemblies means:
"Multiple copies of assemblies with the same name but different version
information can be maintained in the global assembly cache"
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top