Global Assembly Cache - question

P

Piotrekk

Hi

In my solution I have two projects.
First is Library project.
The second project uses this library ( dll ).
I am registering this assembly in global assembly cache ( by .net
configuration tool ).
Key pair is generated for the assembly using VS2005 ( I also use VS to
sign my assembly using this keypair ) Everything works fine.
I am adding reference to created dll, on the second project.

Then I need to add some code and rebuild my DLL by right-clicking
first project/build.
I have observed that changes are visible for the second project only
when I register assembly to GAC again.
Why is that?

Kind Regards
Piotr Ko³odziej
 
H

henk holterman

Piotrekk said:
....
The second project uses this library ( dll ).
I am registering this assembly in global assembly cache ( by .net
configuration tool ).

Then I need to add some code and rebuild my DLL by right-clicking
first project/build.
I have observed that changes are visible for the second project only
when I register assembly to GAC again.
Why is that?


You don't need to register the Library in the GAC and you probably
shouldn't.

Just remove it from the GAC and re-refernce it from the other Project
using the 'Projects in Solution' tab. Developmont will be seemless.

If you really want the assembly in the GAC you can do that on deployment.

-HH-
 
P

Piotrekk

This doesn't answer my question at all. I need this dll to be in GAC
and I have problem of different kind.
 
H

henk holterman

Piotrekk said:
This doesn't answer my question at all. I need this dll to be in GAC
and I have problem of different kind.

Do you really need the assembly to be in the GAC _during_ development?
In that case the behaviour you see is normal... Maybe you can
re-register it each build using a build event.


-HH-
 
P

Piotrekk

Why is that normal?I cannot understand why do I need to register it
after each build. GAC holds assembly information which doesn't change
when assembly is rebuilded.

PK
 
H

henk holterman

Piotrekk said:
Why is that normal?I cannot understand why do I need to register it
after each build. GAC holds assembly information which doesn't change
when assembly is rebuilded.

The Gac holds a copy of your assembly. (Take a look with anything but
Windows Explorer).

But why do you think this assembly needs to be in the GAC at all? And
why during development?

-HH-
 
A

Alain Boss

Piotrekk said:
Hi

In my solution I have two projects.
First is Library project.
The second project uses this library ( dll ).
I am registering this assembly in global assembly cache ( by .net
configuration tool ).
Key pair is generated for the assembly using VS2005 ( I also use VS to
sign my assembly using this keypair ) Everything works fine.
I am adding reference to created dll, on the second project.

Then I need to add some code and rebuild my DLL by right-clicking
first project/build.
I have observed that changes are visible for the second project only
when I register assembly to GAC again.
Why is that?

Kind Regards
Piotr Ko³odziej

The GAC is a special folder where .NET assemblies are stored. If you
register an assembly in the GAC a copy is stored. Take a look at
c:\windows\assemly but do not use the standard windows explorer. use the
command box instead (or anything else other than windows explorer)
because the explorer contains an add-in that displays the GAC
differently from how the files are actually stored.

The GAC should be used only for assemblies that are used for multiple
programs (e.g. framework, loggers etc). Usually it is not necessary to
put your own assemblies in the GAC. However, you should still sign them.

If you use the assembly in the GAC rather than referencing the DLL in
the project you have to update the GAC with every change. As Henk told
you already, it is better to reference the DLL rather than putting it in
the GAC especially during development.

Alain
 

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