Accessing dlls from gac

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

What are the advantages of storing ones class project dlls in gac? How can
one access these dlls?

Thanks

Regards
 
The GAC is a deployment feature to allow DLLs to be shared among the
applications (but allowing versioning). If your DLLs are not shared, IMO
it's better to keep them private in the application's folder. The run-time
has a probing system to find and load DLLs:

How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/d...ide/html/cpconhowruntimelocatesassemblies.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Thanks for that. I do want to share my dll among several apps. So I have a
dll MyClass.dll in the 'C:\Windows\Assembly' folder. The sink file is
MyClass.snk. So how do I access functions in the MyClass.dll from my vb.net
apps?

Thanks

Regards
 
The .snk file is not a "sink" file (AFAIK) but the acronym of Strong Name
Key, which is the file used to sign the assembly.

To access MyClass.dll from your VS.NET project, just add a reference to it
(References node of the Solution Explorer), Add Reference context menu,
browsing it in your file system. During development, the Dll should reside
in some folder outside the GAC (the GAC is only a deployment feature, not a
development feature). When referenced, the dll will be copied to the "bin"
output folder of your .NET app, to be located by the app at run time. At
deployment time, since it will be in the GAC, it does not need to be along
with the app executable.


--
Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 

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

Back
Top