Forgive me if I am reviving a dead horse here. I have read the FAQ and searched the forum, and still need an answer to give a BizTalk developer who insists we must GAC the CSLA framework and any business objects we create. Whenever we do that, we get an error under remoting that says "DLL can not be found"(p).
We can GAC the business objects and they load from wherever, but the framework must be in the BIN folder of the remoting host, the web client applications, and anywhere else we need it.
Thanks for any help,
Brian
RockfordLhotka:If you put Csla.dll into the GAC then you'll need to use its fully qualified name rather than the short name when setting up your web.config file. I haven't spent any time researching this - I generally recommend against using the GAC - but that is the basic solution to this problem.
I've been having a rough time just getting Csla into the GAC, let alone accessing it. Is there something unusual that I need to do? I added another assembly to the GAC at the same time, without issue, so I know I know how to do it, normally.
Also, when you say you generally recommend against using the GAC, do you mean just for Csla, or in general? I'd be interested to hear the "why" in either case, if you don't mind. We've been having this discussion internally and the GAC seems much superior to including the .dll with every project. Then again, I do ASP.NET development, which means I have a really good idea about what the destination looks like -- I could see some issues with Windows development.
What problem are you having adding Csla.dll to the GAC?
I recommend against the GAC in general. This is because I very
much think you should only use a technology because you need its features. So
you should only use the GAC because you specifically need something it gives
you, and because you can live without the things it takes away.
The GAC takes away registry-free installation. To me that is a
huge loss, not only for client apps, but also for server apps. No longer can
you simply copy the dll to the target location and use it. Now you have to log
into the machine and run a registration step. But for you this may be a
non-issue, and you may feel no loss.
But even so, the GAC introduces complexity, and so should only
be used if you need what it offers.
And what it offers, primarily, is that the dll will be loaded
into physical RAM just once for the machine. This is only important if your dll
is used by multiple processes on the machine. On a client, this only typically
happens for the .NET runtime and for a handful of UI controls. On the server it
can happen for your framework assemblies, but virtually never for app-specific
assemblies, since they are per-virtual root and thus are per-process. So the
GAC doesn’t offer its key value to most of the assemblies people create.
The GAC also offers COM-like versioning: the ability to force an
application to upgrade to a newer assembly even if it hasn’t been tested
against that assembly. To me this is not a positive: it brings the DLL Hell of
COM into the .NET world. But to some, very small number, of organizations who
had (and have) the iron discipline to make COM versioning actually work to
their benefit, then this aspect of the GAC is a positive. But to the vast
majority of organizations where DLL Hell was a very real, and very bad thing,
this use of the GAC is most certainly a negative feature.
In short, for most organizations, the only value to the GAC is
if they have a shared framework that is used across many processes (virtual
roots on a web server), and where that assembly is physically large
enough that it actually matters to save RAM by loading it only once into
physical memory.
Against that you must weigh the costs of loss of easy
deployment, increased complexity and potential to re-engage COM-like versioning
and DLL Hell.
The result, to my mind, is that the GAC is almost never of value
to the vast majority of assemblies or applications.
Rocky
From: mercule
[mailto:cslanet@lhotka.net]
Sent: Thursday, April 19, 2007 4:01 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] GAC and CSLA.NET
RockfordLhotka:
If you put Csla.dll into the GAC then you'll need to use its fully qualified name rather than the short name when setting up your web.config file. I haven't spent any time researching this - I generally recommend against using the GAC - but that is the basic solution to this problem.
I've been having a rough time just getting Csla into the GAC, let alone
accessing it. Is there something unusual that I need to do? I added
another assembly to the GAC at the same time, without issue, so I know I know
how to do it, normally.
Also, when you say you generally recommend against using the GAC, do you
mean just for Csla, or in general? I'd be interested to hear the
"why" in either case, if you don't mind. We've been having this
discussion internally and the GAC seems much superior to including the .dll
with every project. Then again, I do ASP.NET development, which means I
have a really good idea about what the destination looks like -- I could see
some issues with Windows development.
I don't think you are disagreeing at all. My point is merely that you should use the GAC only if you get value from the features it provides. If you do get value, than by all means use it! But if you don't get value, then don't use it because it is just a complication you don't need.
Most people don't need it for most assemblies. Csla.dll is actually one possible exception, because it is likely to be used across multiple virtual roots - as opposed to your typical business assemblies that are likely per-application.
But even then, you need to weigh the costs vs the benefits and make a business decision about whether using the GAC makes sense for your specific setting.
I think I may have botched the strong naming of the Csla framework, actually. I didn't realize it until boo said something. I'll give it another shot and see how it works.
I guess I'm not too far off from what you guys are saying on the GAC. I was only looking at using it for things like CSLA, custom providers, etc. I don't think it makes sense for assemblies like a specific implementation of a BOL.
Not to argue, but I would doubt you are able to run CSLA 2.0 "bone stock" on the client side without a copy in the "bin" folder. Our mileages must truly be varying.
I have a solution which involves a change to one line of code in a CSLA class that allows a true GAC reference on the client side to work. Nobody seems to want it but me, so I'll refrain from posting it unless requested.
Thanks for giving me a place to soundboard this problem. The journey to a solution has been much less lonely being able to post here.
Hi!
My program includes two part: client and
server(.Net Remoting). I want to share a value for many clients, data that
flows from client to server and then from server back to client and “many
other clients” that connected to server, changes on either end are
carried across the network.
Do Global Context support?
Thanks.
No, nothing in Csla.ApplicationContext is designed to solve that
problem.
You may consider using the ASP.NET Application object, assuming
you have just a single application server.
If you have, or might have, a cluster of application servers though,
the problem clearly becomes more complex because you need some way to share
that value across all your servers. The obvious answer in that case is the
database.
Rocky
From: Pham Huu Le Quoc
Phuc [mailto:cslanet@lhotka.net]
Sent: Friday, August 03, 2007 11:13 PM
To: rocky@lhotka.net
Subject: [CSLA .NET] How to share Global Context for many clients and
one server?
Hi!
My program
includes two part: client and server(.Net Remoting). I want to share a value
for many clients, data that flows from client to server and then from server
back to client and “many other clients” that connected to server,
changes on either end are carried across the network.
Do Global
Context support?
Thanks.
If there’s a simple change like that, which wouldn’t
require the use of the GAC, I will certainly consider putting into the
official code.
I am curious what the problem is – why doesn’t it
work as-is?
Rocky
From: Brian O
[mailto:cslanet@lhotka.net]
Sent: Friday, August 03, 2007 10:48 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] GAC and CSLA.NET
Not to argue, but I would doubt you are able to run CSLA 2.0
"bone stock" on the client side without a copy in the "bin"
folder. Our mileages must truly be varying.
I have a solution which involves a change to one line of
code in a CSLA class that allows a true GAC reference on the client side to
work. Nobody seems to want it but me, so I'll refrain from posting it unless
requested.
Thanks for giving me a place to soundboard this problem. The
journey to a solution has been much less lonely being able to post here.
Copyright (c) Marimer LLC