I know I may get some comments saying that the GAC should be used for shared
assemblies, but it’s so much easier to maintain XCOPY deployment with a
consuming assembly in a directory by itself with the shared assemblies it
Let me give a scenario where I would do this: I have a windows application
that is modularized into main features. The base directory has the main
executable and all the shared libraries. Feature teams work on the main
features and deploy the feature’s .dll files into a subdirectory along with the
version of the shared assemblies they compiled and tested against. Maybe I
release a new version of the program shell (the main assembly). That team has
to test against the most current build of the shared assembly and deploy. The
feature assemblies aren’t retested and continue to use the assembly they were
tested with. A single feature team can redeploy their feature along with the
current build (at that time) of the shared assembly. The features are
completely decoupled and the deployment is easy.
Consider the alternative: the main executable and feature assemblies are
deployed to the same directory. No matter the feature, the shared assembly in
the current directory is loaded. I version the main EXE, and it needs the
latest version of the shared assembly. I have a situation where I have to
retest all the features because they were built against an
older version of the shared assembly. I have no way to version each major piece
separately. Or if a feature team makes a new release, and they have to have the
latest shared dll, you have a major retest burden every time this happens. If
you keep the binaries separate, you avoid this problem.
Put the shared assembly in the GAC, you say? Yes, that would work. If you
prefer it, go ahead, but what, really, is the benefit? There is no
real performance difference. It is another method that would
work, but there is no benefit to the increased deployment burden. KISS. Keep
it simple, stupid, that’s my motto. The simplest thing that will work. If I’m
wrong, I would love to hear the real benefits
of the GAC.
I’m not knocking the MS team who made the GAC, but XCOPY is just such a great
deployment model, why mess with a good thing?