Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use 2 third party .net libraries when their unmanaged dependencies conflict?

Say I have a .net assembly A.dll that uses third party .net assembly B.dll and third party .net assembly C.dll.

It turns out that internally B.dll uses unmanaged assembly D.dll (version 1) and C.dll uses unmanaged assembly D.dll (version 2).

B and C come from different vendors and are only tested with their correct version of D.dll.

How can I deploy A such that B and C will work correctly?

Edit:

I think there are three distinct problems:

1) How to externally control the paths B and C use for looking for D .

2) How to externally control the paths D uses for its own dependencies.

3) How to ensure the process directs function calls correctly.

My research suggests that without compile time control of all modules this may be impossible...

like image 551
morechilli Avatar asked Nov 14 '22 17:11

morechilli


1 Answers

i would try to configure several bin folders by means of "probing" configuration section.

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="bin;bin\B;bin\C"/>
      </assemblyBinding>
   </runtime>
</configuration>

then i would put B.dll and its unmanaged dependencies into bin\B folder, and C.dll and its unmanaged dependencies in bin\C folder.

like image 60
ivan Avatar answered Dec 06 '22 05:12

ivan