.Net of the same type in two different assemblies

I have an application that loads two prefabricated DLLs. The first dll is a common dll, and the second dll has a link to another version of the first dll. All assemblies are unsigned.

App.exe → dll1_v1.dll, dll2.dll
dll2.dll → dll1_v2.dll

Both dll1_v1.dll and dll1_v2.dll have the same types, but different implementations.

If I have dll1_v1.dll and dll1_v2.dll in the exe code base path, then both are loaded, and all instances of objects in app.exe point to dll1_v1.dll, and in dll2 they point to dll1_v2.dll.

If I need to point dll1_v2 to dll1_v1, is it correct to remove dll1_v2.dll from the code base and add the AssemblyResolve event handler so that I can return the assembly for dll1_v1.dll instead of dll1_v1.dll?

+3
source share
1
+1

Source: https://habr.com/ru/post/1769815/


All Articles