DLL Versioning without GAC

  • Thread starter Thread starter Roy Chastain
  • Start date Start date
R

Roy Chastain

I have product that is written in C# and MC++ and is spread across 20+ projects in one Visual Studio solution. One of those
projects simply creates a DLL that is nothing more than class definitions (data members only; no methods).

There is another DLL that is created by another developer in Delphi. His DLL requires my definition DLL and then the rest of my
product (Visual Studio solution) requires his DLL.

What I am looking for is a sane way to make this work without having one or both of us putting the 'base' DLLs in the GAC.

My current plan is that we freeze the version numbers for my definition DLL and the Delphi created DLL at 1.0.1.0, but I really
don't like that plan.

Is there a better one?

BTW. All the assemblies are strongly named.

Thanks
 
Roy Chastain said:
I have product that is written in C# and MC++ and is spread across 20+
projects in one Visual Studio solution. One of those
projects simply creates a DLL that is nothing more than class definitions
(data members only; no methods).
There is another DLL that is created by another developer in Delphi. His
DLL requires my definition DLL and then the rest of my
product (Visual Studio solution) requires his DLL.

What I am looking for is a sane way to make this work without having one
or both of us putting the 'base' DLLs in the GAC.
My current plan is that we freeze the version numbers for my definition
DLL and the Delphi created DLL at 1.0.1.0, but I really
don't like that plan.

You should. The AssemblyVersion is there to control binding and assembly
loading behavior. The AssemblyFileVersion is there to keep track of build
numbers and revisions.

David
 
I am WELL aware of what build and revision numbers are for. I also know by having the other developer change his assembly info to
have a hard coded version number, he will never remember to change it when he changes the DLL for release and we will end up not
getting the new version installed.

Is there not someway to tell a DLL that any version >= to xxx will be acceptable?
 
Roy Chastain said:
I am WELL aware of what build and revision numbers are for. I also know
by having the other developer change his assembly info to
have a hard coded version number, he will never remember to change it when
he changes the DLL for release and we will end up not
getting the new version installed.

Is there not someway to tell a DLL that any version >= to xxx will be acceptable?

Not quite, but you can tell an application compiled against version XXX to
load version YYY instead.

Say you build against AssemblyVersion 2.0.0.0, and later the other developer
delivers AssemblyVersion 2.0.0.1 which adds a new class, but doesn't change
any existing interface or public class. You can make an entry in your
App.config to load the new assembly even though you compiled against the old
one.

<bindingRedirect
oldVersion="2.0.0.0-2.0.0.9" newVersion="2.0.1.0"
/>

You could then use AutoIncrementing AssemblyVersions but each time you get a
new build you will have to either rebuild the dependant assemblies or change
the bindingRedirect in your app.Config.

see

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/html/Binding_Policy.asp

http://www.ondotnet.com/pub/a/dotnet/2003/03/17/bindingpolicy.html

David
 
Back
Top