DLL collision

I have one big problem:
For example:
I am developing A.gha with hello.DLL in “A folder” ,and meanwhile, existing “B folder” have B.gha+hello.DLL,( the 2 version hello.DLL are all 3rd part dll from the same programmer).
but this two hello.DLL are in different version we cannot move them under Library folder.
folder tree Like this:

Library folder:

                    |---- A folder:
                                       |---- A.gha + hello.DLL

                    |---- B folder:
                                       |---- B.gha + hello.DLL


but in real using ,when the grasshopper has finished loading, only one of two “hello.DLL” has been load.it is a big problem.i tried to change the name of one “hello.DLL” into another name, but it doesnot work.
Hope advise! Thank you!

1 Like

If they are managed DLLs, you will need to strong-name DLLs to enable side-by-side loading. It is a bit difficult to do if you don’t control the DLLs.
If they are native DLLs, you can rename either of them, and redirect PInvokes to the correct DLL.

It is slightly beyond normal coding things but it can be done. You need to sign a third-party library with a new “key” (acting as an identifier). Then your libraries reference the new strong-named DLLs and .NET CLR will load different versions at the same time.

If the higher version of that library doesn’t have a breaking change which prevents the one, dependent on lower verson, GH plugin to malfunction, I would delete the lower version.

Other solutions include isolated AppDomain (won’t be supported by Rhino 8), or isolated process.

3 Likes

thank you Keyu, I will try it!