Package OR GAC

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,016
Location
Cambridge, UK
Programming Experience
5-10
Hi all, having just completed my custom control. I found myself left with one question.. How do i deploy it and whats the best way?

There are two options as i see it....

1. Simply add a reference to it in my projects and have it packaged with my application.

2.Add a key file, and the proper assembly information to the top of my usercontrol file and have it deployed in the GAC.

Can anyone shed any light on the advantages/Disadvantages of these.

Thanks.
 
Stated by Microsoft packaging it with the application is the preferred way to do it in .Net unless you for some reason have to put it in GAC :)

So unless you are the great provider everybody know of and is using for several installed applications on each machine... package it with your application.

Take MS Office dlls for instance, several of these are used by all applications in the package, these are also expected to be available in different environments on a machine. If Office is installed, any developer will expect to find the automation tools for it available in the preferred programming editor.

Another issue is early/late binding. If you depend on a library and compile with early binding to one version without bundling it and the target machine got another version, the deployed application will fail. With late binding to COMs in GAC the deployed application can bind to different compatible versions of that library installed on different target machines.

So why don't they want everything just put into GAC? Could there be other reasons than performance? Everything in GAC must be loaded into system somehow, readily available anytime. As a local resource it live and dies with the use of the local application.
 
These are the conclusions that i have come to also. However in .NET strong typing seems to be something that we should always aim for and this would be one of the advantages of using the GAC this is why i don't understand why packaging with the app sems to be the preferred way. Still remains a mystery to me if i'm honest and the points you have highlighted would seems to lead toward deploying with app. Perhaps i making to much of an issue out of this.
 
Early binding and deploying (with package) is "strong typing" so to speak.

You are not confusing with "strong naming"? Signing with strong names could be used for local assemblies too, and is more of a security issue, binding to strong name assemblies prevent parts of application to be switched by a foreign assembly since they can't fool the signing. Strong naming also makes it possible to have different versions of the same assembly (with same simple name) in the GAC at the same time.
 
Back
Top