Adding a reference from the GAC.

F

Frank Rizzo

Hello, an assembly I want to reference is installed in the GAC and
doesn't have a local copy (e.g. somewhere that is not
c:\windows\assembly...). How do I reference it from VS2005?
 
P

parez

Hello, an assembly I want to reference is installed in the GAC and
doesn't have a local copy (e.g. somewhere that is not
c:\windows\assembly...). How do I reference it from VS2005?


Add Reference.. in the .NET tab you should see if it is registered in
GAC
 
I

Ignacio Machin ( .NET/ C# MVP )

Hello, an assembly I want to reference is installed in the GAC and
doesn't have a local copy (e.g. somewhere that is not
c:\windows\assembly...).  How do I reference it from VS2005?

Hi,

You should see it in the .NET tab of the Add Reference dialog
 
C

Chris Dunaway

You should see it in the .NET tab of the Add Reference dialog

I don't believe this is true. Just because something is in the GAC
does not mean that it will appear in the .net tab of the Add
References dialog.

It would be quite reasonable for someone to install an assembly in the
GAC but not want it available for use by other developers.

Chris
 
I

Ignacio Machin ( .NET/ C# MVP )

I don't believe this is true.  Just because something is in the GAC
does not mean that it will appear in the .net tab of the Add
References dialog.

It would be quite reasonable for someone to install an assembly in the
GAC but not want it available for use by other developers.

Chris

I'm not 100% sure if that is true, it might be some config setting
that declare an assembly "hidden" in the GAC, or more precisely a flag
that mark it as "do not show in the list"
I do not think it does exist though.
The GAC is intended to be shared, if you want to have a private
assembly just do not put it there.
 
R

Rob Windsor

Hello, an assembly I want to reference is installed in the GAC and
doesn't have a local copy (e.g. somewhere that is not
c:\windows\assembly...). How do I reference it from VS2005?

You can add the reference from the DLL in the GAC. The GAC is just a
series of folders with a special naming convention.

Let's say you're looking for an assembly called MyLib.dll. To see
where the DLL is stored, just open a command prompt and type the
following commands:

c:
cd \windows\assembly
dir MyLib.dll /s
 
F

Frank Rizzo

Ignacio said:
I'm not 100% sure if that is true, it might be some config setting
that declare an assembly "hidden" in the GAC, or more precisely a flag
that mark it as "do not show in the list"
I do not think it does exist though.
The GAC is intended to be shared, if you want to have a private
assembly just do not put it there.

Chris is absolutely correct. Just because the assembly is in the GAC
does not mean that it will be available in the Add Reference... dialog.
The contents of the Add Reference .NET tab are defined by registry
keys that list the folders to interrogate.

The question is how does one reference a DLL that does not show in the
..NET tab. SharpDevelop, for instance, also has a GAC tab (in addition
to the .NET tab).


Regards
 
H

Hals !

You could use the dir <assemblyname> /s to find the actual path of the
assembly within GAC and type the full path in the addreference
window(select browse tab).

Thanks
 

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