0

I have the folloing structure after setting up one of our programs on the customers machine:

c:\Program Files (x86)\Common Files\company\DLL\LicenseServer\

  • LicenseServer.dll (V1.0)
  • Tools.dll (V1.0)

c:\Program Files (x86)\company\FancyProg1\

  • MyProg1.exe (.net)

MyProg1.exe is using the LicenseServer.dll from the common files-folder which by itself has a reference to Tools.dll. The reference at the Licenserver was build with "SpecificVersion=False". LicenseServer ist registered via Regasm /codebase for use as com-server as well

Now the user wants to setup another Program which also uses LicenseServer.

After that my Folders look like this c:\Program Files (x86)\Common Files\company\DLL\LicenseServer\

  • LicenseServer.dll (V1.0)
  • Tools.dll (V1.1)

c:\Program Files (x86)\company\FancyProg2\

  • MyProg2.exe (native, c++)

It's setup contains LicenseServer.dll still in V1.0 but the Tools.dll has evolved to V1.1 (some additional Methods, but no change in any public methods definition). The LicenseServer of MyProg2 was build with a Reference to Tools.dll V1.1 (still with "Specific Version=False") but has no other change so its still V1.0.

While setting MyProg2 on the target-machine the setup-Program does not Copy LicenseServer.dll because it has the same version that the one already installed. Yet it updates the Tools.dll from V1.0 to V1.1 because is brings a newer one.

Well, after that MyProg2 cannot reference LicenseServer. It won't load Tools.dll because it still searches for V1.0. Notice that MyProg2 is a native-c++-program with uses LicenseServer as a Com-Server. Its registered via Regasm /codebase.

However, MyProg1 (the .net-program which loads LicenseServer as a regular .net-dll) works and uses the newer Tools.dll

So the question is: how to make LicenseServer as a Com-Server work, even when there is a newer Tolls.dll in it.

suriel
  • 191
  • 1
  • 10
  • If you only added COM methods and you didn't break existing ones, just don't build LicenseServer with the V1.1 Tools but with the V1.0,, or create an intermediary V1.0 typelib (or a .NET assembly that only contains V1.0 interfaces) independent from the Tools binary, and reference that, not the Tools binary. – Simon Mourier Feb 13 '23 at 19:16
  • Only LicenseServer is RegAsm-ed and has a Com-Interface. Tools.dll is a .net-dll referenced by LicenseServer.dll. The binaries of Tools and LicenServer are part of the setups of Prog1 and Prog2. The source of LicenseServer and all its references including Tools.dll are part of the Progs2-Solution and therefore built everytime Prog2 is build against the current version of Tools.dll. Prog1 uses only the binaries built by Prog2 – suriel Feb 13 '23 at 22:25

1 Answers1

-1

The trick is not to version LicenseServer and all its references independently, but to give them all a new, same version number everytime Prog2 gets a new release. Even when there was noch change in the sources. This prevents only one component from being updated because it is newer. During setup, either all or no components are then replaced

suriel
  • 191
  • 1
  • 10