Is it any point having shared assemblies without having them in the GAC

T

Tony Johansson

Hi!

If you have assemblies in the GAC all application will look for the needed
assembly in local directory first and then in the GAC
So to have a shared assembly in another place then GAC seems unlogical

So I just wonder If someone can mentioned if there might be any point to
have a shared assembly without having it in the GAC ?

//Tony
 
A

Andy O'Neill

Tony Johansson said:
Hi!

If you have assemblies in the GAC all application will look for the needed
assembly in local directory first and then in the GAC
So to have a shared assembly in another place then GAC seems unlogical

So I just wonder If someone can mentioned if there might be any point to
have a shared assembly without having it in the GAC ?

//Tony

Yes, you share functionality with reduced risk of versioning issues.
Plus you might "share" the assembly via a web service for one application
and deliver it with another desktop one.

It's quite common for developers to have no access to live servers.
So one can find oneself trying to maintain an application that shares
something in the GAC with some other applications but you don't know which
and you can't see what versions which use and...
You can easily find your team deciding to ban use of the GAC for code
written in house.
 
T

Tony Johansson

Andy O'Neill said:
Yes, you share functionality with reduced risk of versioning issues.
Plus you might "share" the assembly via a web service for one application
and deliver it with another desktop one.

It's quite common for developers to have no access to live servers.
So one can find oneself trying to maintain an application that shares
something in the GAC with some other applications but you don't know which
and you can't see what versions which use and...
You can easily find your team deciding to ban use of the GAC for code
written in house.

It's also possible to use the codebase funtionallity in the config tool to
be able to share
assemblies in the same directorys instead of using the GAC. You might want
to share an assembly between
a coupe of application but you don't want to make it global by using the
GAC.

//Tony

//Tony
 
A

Adam Clauss

Tony said:
Hi!

If you have assemblies in the GAC all application will look for the needed
assembly in local directory first and then in the GAC
This is incorrect. If an application finds an exact match (version
numbers, etc) in the GAC for an assembly it is looking for, that one
will trump any local copy. We got confused by this a few times (tried
to push out temporary code for one of our applications in it's local
directory, only to find that nothing changed).
 
T

Tony Johansson

Adam Clauss said:
This is incorrect. If an application finds an exact match (version
numbers, etc) in the GAC for an assembly it is looking for, that one will
trump any local copy. We got confused by this a few times (tried to push
out temporary code for one of our applications in it's local directory,
only to find that nothing changed).

Hi!

I think you missunderstood me.
If you have an application lets call it myApplication.
This myApplication is dependent on the shared assembly which is called
MyDll.
If you have both myApplication and MyDll in the same application directory
which we
call MyAppdirectory.
So if you now start MyApplication from this MyAppdirectory the appliaction
will first look
in this MyAppdirectory before looking in the GAC.
Do you mean this this is incorrect ?

//Tony
 
A

Adam Clauss

Tony said:
I think you missunderstood me.
If you have an application lets call it myApplication.
This myApplication is dependent on the shared assembly which is called
MyDll.
If you have both myApplication and MyDll in the same application directory
which we
call MyAppdirectory.
So if you now start MyApplication from this MyAppdirectory the appliaction
will first look
in this MyAppdirectory before looking in the GAC.
Do you mean this this is incorrect ?

//Tony
If you had a copy of MyDll in the GAC and in the local directory, the
default behavior would cause MyApplication to look in the GAC first,
then the local directory. (This is opposite of what you would normally
think based on Win32 DLL lookups).


-Adam
 
T

Tony Johansson

Adam Clauss said:
If you had a copy of MyDll in the GAC and in the local directory, the
default behavior would cause MyApplication to look in the GAC first, then
the local directory. (This is opposite of what you would normally think
based on Win32 DLL lookups).


-Adam

I'm very surprised but it seems to me that you are sure about it.
But still it was not was I had expected !

//Tony
 
A

Arne Vajhøj

So to have a shared assembly in another place then GAC seems unlogical

So I just wonder If someone can mentioned if there might be any point to
have a shared assembly without having it in the GAC ?

Oh yes.

Splitting your build artifacts in multiple assemblies makes
it a lot easier to reuse and update code.

To GAC or not to GAC that is not the question.

Well - it is a question, but it is a minor question compared
to the important question on structuring your apps. And potentially
you could have some DLL that was put in GAC on some system and not
put in GAC on other systems.

Arne
 

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