Accessing a dll in the GAC

G

Guest

Having created my dll, I have installed it into the GAC. All fine, no problems.

The trouble starts when I try to access this dll.

How do I tell my program to look in the GAC for the dll? Does it do this
automatically? Do I have to specify it in the app.config file?

Also, if I want to reference the dll in future, is there a way to get it to
appear in the .NET tab of the Add Reference dialog in Visual Studio 2003?

Sorry, but I'm new to this GAC stuff.
 
P

Phil Wilson

"load ..from C/C++" needs a bit more definition. In managed C++ you'd
probably have a reference to the .NET assembly at build time and at runtime
it would be loaded from the GAC, as in the previous answer. If you mean you
want to load it manually into a C++ app, you'd use the CLR hosting types of
APIs or Assembly.Load from managed code.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Vitaly said:
But what to do if I want to load .NET module from C/C++ code? I do now
this from SUN Java code. How do I find my DLL location in GAC? See my
module Setup for MS Visual Studio 7.1 .NET with examples at
http://www.simtel.net/product.php[id]95126[sekid]0[SiteID]simtel.net

Vitaly

Norman Yuan said:
Yes, .NET app will look GAC for the referenced dll first, if not, then
look into the same folder, then subfolder, or folder specified in
app.config...

Place dll into GAC, does not make it appear in VS's "References" dialog
box, you need to modify a Windows Registry for this. Search the NET or MS
KB would lead you to how to do this. Actually, it is recommended you keep
a copy of the dll (exact version of the dll you placed into GAC)
somewhere in your local drive and set reference to it in your developing
project. As mentioned above, although your developing app has reference
to the dll file somewhere in your drive, the app always try to load it
from GAC first.
 

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

Top