Herfried K. Wagner said:
I don't think the DLL applies to the GAC or the Win32 Side-by-Side cache
because both support assembly versioning to prevent the versioning issues
typically referred to as DLL Hell. Note that assemblies installed into
the GAC must have a strong name which makes sure that no other vendor can
publish a fix of an assembly.
When i pressed the submit button and reread the posting i was already afraid
that this was unclear
in my response you will see a few paragraphs below that i am aware of the
versioning mechanism
My aversion against the GAC is due to the fact that you are depending in the
end on a reference count for every version to make sure that it is there and
won`t break apps, my personal opinion is that it introduces unnecesay
deployment complexity ( write an installer that delivers a file to the GAC
to call one, need of administrator interference due to system ACL )
Most people use Gacutil.exe or Xcopy to deploy there assembly to the GAC
while they should use a installer to do so because these do not provide
assembly reference counting .
Yep, that's the problem in Windows versions prior to Windows 2000 (which
came with Windows File Protection). Windows XP/Server 2003 even provide a
mechanism for Win32 assemblies (Side-by-Side cache).
Updates in contrast to new versions of an assembly don't break the
compatibility. If they do, that's due to a mistake by the developer,
which should not occur. The problem with installing each assembly used by
an application into its application directory is that fixes for the
assembly cannot be rolled out easily because it's not clear which
application uses the DLL. Rememver the JPEG security hole in the GDI+
assembly. Microsoft had to release a separate tool that searches for this
DLL on the system and patches installed versions.
Well you are right , however in the company`s i have worked for i wouldn`t
bet my life on the fact that my collegues did not break the compatibility
so i choose to be on the safe side .
But to rephrase this, every advantage has a dissadvantage
I believe Microsoft does only share the opinion for Win32 assemblies prior
to Windows XP/Server 2003. However, Windows XP/Server 2003 both come with
the Side-by-Side cache ("%WINDIR%\WinSxS") which is an unmanaged
counterpart to the GAC.
well
< snip from MSDN developers guide >
You should share assemblies by installing them into the global assembly
cache only when you need to. As a general guideline, keep assembly
dependencies private, and locate assemblies in the application directory
unless sharing an assembly is explicitly required. In addition, it is not
necessary to install assemblies into the global assembly cache to make them
accessible to COM interop or unmanaged code.
< snip from MSDN developers guide >
i read this as : Xcopy deployment is the prefered way
the mono dev group has it stated like this
What Should Be Installed to the GAC
Not all assemblies should be installed to the GAC. In fact apart from system
assemblies very few assemblies should be installed to the GAC.
Installing an assembly on the GAC involves a commitment to keep the API
backwards compatible. If you are to break compatibility, you will have to
change the version and ship and maintain as many copies as you have versions
to avoid breaking existing applications.
Here are the criteria an assembly should meet to be installed into the GAC:
a.. Useful to more then one application - There is no point to sharing a
assembly if only one application is going to use it. If a assembly is only
used by one application or is very tightly coupled to an application
side-by-side deployment is a better solution then the GAC
b.. Only loads assemblies that are in the GAC - If your assembly loads or
references assemblies that are not in the GAC it should not be installed to
the GAC.
c.. Commitment to maintain a backwards-compatible library, commitment to
use different versions on API breakage - Unless your API is mature you
really want to avoid using the GAC because you will make breaking changes or
need to refactor your library. If you have existing users, the burden is on
the user to install multiple versions of your library.
If your library does not match the above criteria, or you are not in a
position to guarantee backwards compatibility of the libraries at this time,
you should encourage your users to link and develop against a particular
version and to ship the library bundled with their software.
I would not consider multiple versions of the same DLL on the system as
DLL Hell. DLL Hell describes versioning problems, not DLL redundancy on a
system.
I think the term is often misused because the end result is the same , an
application that will not run because of a missing dependancy or doesn`t
have the required interface or version
The difference in thoughts we have is because you are probably a wishfull
thinker ( positive aproach ) i am in contradiction a true pessimist if i
have to forsee a problem in 2 scenario`s and one is postive and the other is
negative i go for the negative version ( coder will commit himself to
maintain compatibility is read by me as "Coder will in a point of time
forget his commitment" and so break my app , solution i ship the required
dll with my app )
JMO
Michel Posseth [MCP]