Deploying class library into GAC

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Hello.

I have installed my .dll into the GAC using the Gacutil.I did this by first
creating a strong name key and adding the AssemblyKeyFile attribute to the
AssemblyInfo.vb file.

I thought doing so would result in being able to add a reference to it in
subsequent projects by selecting References/Add Reference, and selecting it
from the .Net tab.

Unfortuately I guess I was wrong because it's not there.

What needs to be done so that it shows up in this list?

Thanks in advance,

Mike
 
this can be achieved a couple of ways:

You can copy an instant of your assembly to the following directory:

....\vs.net\common7\ide\publicassemblies folder
or

You can add a registry key, such as the following, which points to the
location of the assembly

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\MyAssemblies]@="C:\\MyAssemblies"


check out the article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;306149
http://www.codeproject.com/dotnet/demystifygac.asp?msg=1071004

HTH

Ollie Riches
 
Keep in mind that the GAC is a deployment choice, not a development
repository for assemblies. The assemblies that VS references are in the
Windows\Microsoft .NET Framework\<Version> folder, not the GAC. The location
that you use for references at development time has pretty mch nothing to do
with where Windows will search for the assembly when you run your app, so
you can add a reference to it by browsing to it on disk, and install it in
the GAC when you deploy the app, if that's your choice.
 
Good point. It is also important to note that the GAC is intended as a
central repository that serves another purpose, and that is, providing a
single location for assemblies that are used by many applications. If an
assembly is only used by 1 or 2 applications, I can't imagine that security
is always such an issue that it should be deployed to the GAC. I have often
run into a similar attitude with regards to the ASP.Net web.config file.
Developers are concerned about keeping it in the root folder of their web
application. However, as IIS is, by default, set up to refuse access via
HTTP to the web.config file, unless someone were able to hack into the
server file system, the web.config file is not in any danger of being seen.
And, if anyone manages to hack into the server file system, the security of
the web.config file is the least of problems for the network adminstrator!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
I'd rather be a hammer than a nail.

Phil Wilson said:
Keep in mind that the GAC is a deployment choice, not a development
repository for assemblies. The assemblies that VS references are in the
Windows\Microsoft .NET Framework\<Version> folder, not the GAC. The
location that you use for references at development time has pretty mch
nothing to do with where Windows will search for the assembly when you run
your app, so you can add a reference to it by browsing to it on disk, and
install it in the GAC when you deploy the app, if that's your choice.
--
Phil Wilson [MVP Windows Installer]
----
mike said:
Hello.

I have installed my .dll into the GAC using the Gacutil.I did this by
first creating a strong name key and adding the AssemblyKeyFile attribute
to the AssemblyInfo.vb file.

I thought doing so would result in being able to add a reference to it in
subsequent projects by selecting References/Add Reference, and selecting
it from the .Net tab.

Unfortuately I guess I was wrong because it's not there.

What needs to be done so that it shows up in this list?

Thanks in advance,

Mike
 
Hello Mike,

Take into account that the ideal way is to add reference to the project,
not on the file at the disk.
As they told you, don't use GAC on the development stage.

M> I thought doing so would result in being able to add a reference to
M> it in subsequent projects by selecting References/Add Reference, and
M> selecting it from the .Net tab.
M> Unfortuately I guess I was wrong because it's not there.
M> What needs to be done so that it shows up in this list?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Back
Top