Install to GAC on Remote Servers

J

Jon S.

I have googled this a bunch and it appears that it is not possible to
install to the GAC on a remote machine unless a .msi is created or we use
some 3rd party tool that enables the running of command line apps remotely
(gacutil.exe in this case).

I'm hoping I just missed something, and if not, I'm hoping for some pointers
on accomplishing this.

Using .NET 3.5 beta 2, I'm writing a utility that, amongst other things,
must be capable of installing assemblies to the GAC on both the local
machine and on remote machines visible on the local network. These are all
Windows Server 2003 Web servers in support of ASP.NET Web applications.

We really don't want to separate this GAC installation piece from the
utility (e.g., no .msi or other deployment packaging). Ideally we just plop
the assembly and .snk file into a "launch pad" folder... from which the C#
utility then installs to the multiple other Web servers.

Suggestions?

Thanks in advance!
 
M

Marc Gravell

Well, the first thing I would ask is "why GAC?". This is the most
important question...

Other than core framework components and additions (WSE3, WF/WCF/WPF),
you can do most things without using the GAC (just using the default
or custom probing-paths), and hence use "robocopy" depoyment. I find
this works without any difficulty in almost every case; there are some
exceptions (COM facets, serviced components, etc). With this
knowledge, and knowing that I need to be able to deploy easily to a
farm, I tend to design with "robocopy" in mind, hence avoid GAC [for
my own dlls] like the plague.

The second question would be "why deploy the SNK?". This is only
normally needed on a build-server (or developer desktop). Normally the
thumbprint (or hash, or whatever they call it for SNK) suffices.

As for installing into the GAC... at one point, IIRC, msi was the only
supported route, with "gacutil" classed as a development / debugging
tool. I can't be 100% sure, since I (as above) avoid needing to use
it. And don't forget you need to be admin to use it...

Marc
 
J

Jon S.

<snip>
RE:
<< Well, the first thing I would ask is "why GAC?". This is the most
important question...>>

While I have been using robocopy for a few years now on this particular
system and have been duplicating the .dlls amongst the Web sites, I want to
some of the assemblies amongst a few web sites on a few Web servers. I have
a utility I have been using to "robocopy-deploy" files to the sites.

I just figured that the GAC is here to help us to share a given assemblies
amongst many applications. In my case they are ASP.NET Web apps... thought I
could simplify things by installing once per server rather than once per Web
site.

Is there some problem with using the GAC? Unless I'm reading you wrong, your
questioning seems to imply that it may be more of a problem than a benefit.
If that is in fact the case, then I'd like to know, as I have not yet
installed anything to the GAC and have just read up on gacutil and how it
needs .snk to do it's job. I was going to roll up my sleeves starting
tomorrow to get my head wrapped around the GAC and make this all happen. But
if you've been there and done that and can tell my why it's not worth it, if
that is in fact the case, I'd appreciate that too.
 
M

Marc Gravell

and how it needs .snk to do it's job.
it needs that the assembly has been strong-named with an SNK (¿or
cert?) - however, it doesn't need the actual SNK that was used. The
SNK hash forms part of the full-name of the assembly.

Deploying this may actually present a security risk, in that it would
make it easy for somebody to simulate your dll (including your private
SNK). But generally if somebody can do this they have already
compromised your farm, and you have bigger issues ;-p
But if you've been there and done that and can tell my why it's not worthit...
In my view, it is just dll-hell all over again; GAC-hell. Disks are
cheap, and having separate copies provides an additional level of
isolation between apps (i.e. you can upgrade each version individually
without having to stress over version-forwarding policies, etc). It
may suit some scenarios (and is a bitter necessity for some that I
already mentioned), but I generally avoid the GAC.

I'd welcome other views from the floor...

Marc
 

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