Re: .NET versioning
- From: "Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xxxxxxxxx>
- Date: Sun, 04 Dec 2005 03:34:50 -0800
Richard Grimes wrote:
> Frans Bouma [C# MVP] wrote:
> > If that's the case, you could try to use assembly FILE versions
> > instead. This is also the technique Microsoft uses for hotfixes and
> > service packs on .NET: the version is the same (2.0.0.0) but the
> > file version value in the assemblyfileversion attribute changes.
> > You can install a file with a newer FILE version in the GAC even if
> > it has the same assembly version.
>
> This will work with hotfixes, because Microsoft know what they are
> doing, and anyway, they control the operating system. You *should
> not* do this yourself because it is a return to Win32 DLL Hell.
>
> The reason is that the new version will overwrite the old version.
> The GAC recognises only the .NET version, not the version in the
> VERSIONINFO unmanaged resource, so gacutil just thinks you are
> inserting the same assembly into the GAC and hence it overwrites
> what's there. (When you use gacutil it will put the file in a
> special folder with a name constructed line this: <.net
> version>_<culture>_<publickeytoken> and since these will be the same
> for both versions, the later one will over write the former.)
Isn't that the intention? You have version 1.0.0.0 and you have a
bugfix release. So you release a new version of the dll, same assembly
version. You copy the file into the gac, it overwrites the old one and
all your apps using the 1.0.0.0 version use now the bugfixes.
I said 'bugfixes' thus not new features.
> So you have two assemblies installed into the GAC and two uninstall
> processes, and yet there is only one physical file in the GAC. This
> means that after the first uninstall has been run all applications
> that remain that use this library will stop working. You can get
> around this issue with GAC references.
No install processes, you copy the files.
Uninstalling indeed removes the file, but that's not the point here.
The point is that with a bugfix you otherwise have to produce policy
files and / or recompiles.
> However, since this is just DLL Hell being applied to .NET, I would
> recommend that this 'solution' should not be used.
That's great but what's your 'solution' then? It's always nice to see
people saying "I Don't recomment this!!" and at the same time they
don't have an answer to the question: what to do instead?
Because if you sign your assemblies, and you simply use buildnumbers
for bugfixes, you have to use policy files to be sure everything keeps
on working, OR Recompile everything else.
policy files require an installer, while with fileversions you can
just drag/n/drop the dll into the gac and be done with it: for example
in the situation where you leave it to the user to store the dlls in
the GAC or keep them local to the application. So, for the users who
want the dlls in the gac (or need to, because of some issues with
fusion's loader, like Oracle's ODP.NET dlls can confuse the loader and
it suddenly forgets probing paths) they can simply add them to the gac,
and for the people who don't want to do that, they can simply avoid the
GAC altogether. After all, Microsoft themselves state that if you can
avoid the GAC you should.
FB
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
.
- Follow-Ups:
- Re: .NET versioning
- From: David Levine
- Re: .NET versioning
- References:
- .NET versioning
- From: harvey . kwok
- Re: .NET versioning
- From: Frans Bouma [C# MVP]
- Re: .NET versioning
- From: Richard Grimes
- .NET versioning
- Prev by Date: Re: How to compile for .net 1.1 & 2.0?
- Next by Date: Re: How to compile for .net 1.1 & 2.0?
- Previous by thread: Re: .NET versioning
- Next by thread: Re: .NET versioning
- Index(es):
Relevant Pages
|