473,987 Members | 20,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To GAC or not to GAC, that is the question

During building of one of my applications for deployment it occurred to me
that I was using a common assembly, that most of our future applications
will be using. So I started to wonder if the assembly shouldn't be placed
into the GAC.

I currently have the task of deciding if our common assemblies should reside
in the GAC or should we deploy the assemblies with the application and have
them reside in the application directory. Or some combination of both
depending on the situation, with knowing that if assembly A goes in the GAC
it always goes into the GAC, and if assembly B is private it will always be
private.

What I would like to get as a response is other peoples experience with the
GAC, why to use it and why not to use it. I understand how it works in
theory, but experience is a much better teacher than theory.
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
Jul 21 '05 #1
6 2295
Since you will have multiple applications using the same DLL, the GAC would
be the right place for it.

Annoyances with the GAC are things like having to strong name your
assembly - which then means recompiling anything that uses the dll when the
version changes. You also might run into issues with multiple version of the
same DLL being in the GAC, and figuring out which one your app is trying to
use, etc.

So in situations when the DLL will only be used by one app, it is overkill
to place it in the GAC. However, in your situation it is probably worth it,
so you don't have multiple copies of your dll floating around the machine.

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OP******** ********@tk2msf tngp13.phx.gbl. ..
During building of one of my applications for deployment it occurred to me
that I was using a common assembly, that most of our future applications
will be using. So I started to wonder if the assembly shouldn't be placed
into the GAC.

I currently have the task of deciding if our common assemblies should reside in the GAC or should we deploy the assemblies with the application and have them reside in the application directory. Or some combination of both
depending on the situation, with knowing that if assembly A goes in the GAC it always goes into the GAC, and if assembly B is private it will always be private.

What I would like to get as a response is other peoples experience with the GAC, why to use it and why not to use it. I understand how it works in
theory, but experience is a much better teacher than theory.
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

Jul 21 '05 #2

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Since you will have multiple applications using the same DLL, the GAC
would
be the right place for it.
I don't agree that this is a hard rule. Having multiple copiues of a DLL
"floating around on the machine" may be *just* what you want. Disk space is
cheap. Maintaining complete and total independence between two applications
is also valuable. The simplicity of private assemblies is also nice.

Imagine a scenario where you have 2 apps, both using "the same DLL".
Except the 2 apps get updated and re-deployed at different, independent
intervals. Would you want to run the risk of an update of App A causing
changes in behavior in App B, based on a shared GAC'd DLL, just to save
200kb of disk space? Oh, you're going to rev the version number of the
GAC'd assembly, you say? Then why GAC it in the first place?? If each app
gets its own version, then there is no benefit to the GAC, and there is a
big management cost.

In general, people tend to over-use the GAC. My advice is to Keep it
simple. Avoid the GAC unless you really really need it.

http://www.gotdotnet.com/team/clr/wh...e_the_gac.aspx

-Dino
Annoyances with the GAC are things like having to strong name your
assembly - which then means recompiling anything that uses the dll when
the
version changes. You also might run into issues with multiple version of
the
same DLL being in the GAC, and figuring out which one your app is trying
to
use, etc.

So in situations when the DLL will only be used by one app, it is overkill
to place it in the GAC. However, in your situation it is probably worth
it,
so you don't have multiple copies of your dll floating around the machine.

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OP******** ********@tk2msf tngp13.phx.gbl. ..
During building of one of my applications for deployment it occurred to
me
that I was using a common assembly, that most of our future applications
will be using. So I started to wonder if the assembly shouldn't be placed
into the GAC.

I currently have the task of deciding if our common assemblies should

reside
in the GAC or should we deploy the assemblies with the application and

have
them reside in the application directory. Or some combination of both
depending on the situation, with knowing that if assembly A goes in the

GAC
it always goes into the GAC, and if assembly B is private it will always

be
private.

What I would like to get as a response is other peoples experience with

the
GAC, why to use it and why not to use it. I understand how it works in
theory, but experience is a much better teacher than theory.
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute.

But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein


Jul 21 '05 #3
Marina wrote:

<snip>

Annoyances with the GAC are things like having to strong name your
assembly - which then means recompiling anything that uses the dll when the
version changes.


Isn't this handled through publisher policies?

--
Willem van Rumpt
Jul 21 '05 #4
Well, theoretically, if you updated your DLL, you would want it to available
to all the apps that use it. If this is so, now you have to go searching
for all instance of this DLL on the machine, and find all of your apps, and
update each one of these - instead of just updating it in the GAC and being
done with it.
It really depends on the situation you are in.

"Dino Chiesa [Microsoft]" <di****@online. microsoft.com> wrote in message
news:OW******** ******@TK2MSFTN GP14.phx.gbl...

"Marina" <so*****@nospam .com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Since you will have multiple applications using the same DLL, the GAC
would
be the right place for it.
I don't agree that this is a hard rule. Having multiple copiues of a DLL
"floating around on the machine" may be *just* what you want. Disk space

is cheap. Maintaining complete and total independence between two applications is also valuable. The simplicity of private assemblies is also nice.

Imagine a scenario where you have 2 apps, both using "the same DLL".
Except the 2 apps get updated and re-deployed at different, independent
intervals. Would you want to run the risk of an update of App A causing
changes in behavior in App B, based on a shared GAC'd DLL, just to save
200kb of disk space? Oh, you're going to rev the version number of the
GAC'd assembly, you say? Then why GAC it in the first place?? If each app gets its own version, then there is no benefit to the GAC, and there is a
big management cost.

In general, people tend to over-use the GAC. My advice is to Keep it
simple. Avoid the GAC unless you really really need it.

http://www.gotdotnet.com/team/clr/wh...e_the_gac.aspx

-Dino
Annoyances with the GAC are things like having to strong name your
assembly - which then means recompiling anything that uses the dll when
the
version changes. You also might run into issues with multiple version of
the
same DLL being in the GAC, and figuring out which one your app is trying
to
use, etc.

So in situations when the DLL will only be used by one app, it is overkill to place it in the GAC. However, in your situation it is probably worth
it,
so you don't have multiple copies of your dll floating around the machine.
"Wayne" <Me******@commu nity.nospam> wrote in message
news:OP******** ********@tk2msf tngp13.phx.gbl. ..
During building of one of my applications for deployment it occurred to
me
that I was using a common assembly, that most of our future applications will be using. So I started to wonder if the assembly shouldn't be placed into the GAC.

I currently have the task of deciding if our common assemblies should

reside
in the GAC or should we deploy the assemblies with the application and

have
them reside in the application directory. Or some combination of both
depending on the situation, with knowing that if assembly A goes in the

GAC
it always goes into the GAC, and if assembly B is private it will
always be
private.

What I would like to get as a response is other peoples experience with

the
GAC, why to use it and why not to use it. I understand how it works in
theory, but experience is a much better teacher than theory.
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a
minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein



Jul 21 '05 #5
I guess it can be, now there is another level of complexity and another
thing you have to do to make the transition to the new version - and another
opportunity for something to go wrong and not work.

"Willem van Rumpt" <no***********@ no.thelandslide .spam.com> wrote in message
news:ut******** ******@TK2MSFTN GP10.phx.gbl...
Marina wrote:

<snip>

Annoyances with the GAC are things like having to strong name your
assembly - which then means recompiling anything that uses the dll when the version changes.


Isn't this handled through publisher policies?

--
Willem van Rumpt

Jul 21 '05 #6
I tend to side with Dino - don't use the GAC unless you need to. You should
consider the following:

How are your assemblies installed?
What versioning policy will you use?
How will the assemblies be updated?
How do you plan to use Publisher Policy?
Is the assembly really shared amongst many different, unrelated
applications?
How will the assembly evolve? Once you put it into the GAC you may be stuck
with it living there. If you leave it private now you will always have the
option of putting into the GAC in the future.

One problem with using the GAC are that you cannot xcopy deploy your
assemblies - a special routine to install the assembly into the GAC is
needed. Another potential problem is that if you update the assembly in the
GAC and force all applications to use it you run the risk of breaking a
working application.

Hard disk space is cheap - avoiding unnecessary duplication is not a valid
reason to install into the GAC.

Bottom line for me - the GAC has the feel to me of the NT registry - it was
originally touted as the best place to store all app-specific data, but in
practice it turned out to be a nightmare and led to DLL hell. I think there
will be a tendency to put all sorts of assemblies into the GAC that have no
business being there. IMO only system level shared assemblies that undergo
rigorous regression testing for backwards compatibility should go there
unless there's a darn good reason for ignoring that constraint.

Dave

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OP******** ********@tk2msf tngp13.phx.gbl. ..
During building of one of my applications for deployment it occurred to me
that I was using a common assembly, that most of our future applications
will be using. So I started to wonder if the assembly shouldn't be placed
into the GAC.

I currently have the task of deciding if our common assemblies should
reside
in the GAC or should we deploy the assemblies with the application and
have
them reside in the application directory. Or some combination of both
depending on the situation, with knowing that if assembly A goes in the
GAC
it always goes into the GAC, and if assembly B is private it will always
be
private.

What I would like to get as a response is other peoples experience with
the
GAC, why to use it and why not to use it. I understand how it works in
theory, but experience is a much better teacher than theory.
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3117
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
5057
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
2686
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask it differently. FOUR QUESTIONS: The background: I got three (3) files
3
3113
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
10
3465
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
10
3782
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
53
4140
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
4920
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
4309
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from less to more for example). I have a question object that has two properties that contain the collections Options and Ratings. now I want this kind of layout: --- Rating1 Rating2 Rating3 Option 1 () () ...
3
2575
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div class="not-required-question"><p>Question Text</p><input /></div>
0
10400
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10222
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11700
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10146
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5237
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3820
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.