Quantcast
Viewing latest article 1
Browse Latest Browse All 3

Answer by user11953043 for How can you make a C++/CLI DLL resolve a dependency on managed assemblies (DLLs), without using the GAC?

Updated based on comments...

I found an interesting point in Microsoft's documentation here: docs.microsoft.com/en-us/windows/win32/dlls/… -- "If a DLL has dependencies, the system searches for the dependent DLLs as if they were loaded with just their module names. This is true even if the first DLL was loaded by specifying a full path." This means if those dlls were loaded by any other process the version in memory with that name is what will be used.

Essentially what microsoft's doc is saying is:

You have nothing to worry about unless there are other dlls on the computer with the same module names as #2-#4. Regardless of whether you put those dlls into the GAC. #1 will be loaded by the application using whatever path you specify, #2-#4 will be loaded by module name only.

Your only problem is if your modules #2-#4 do not have good distinctive names and there could exist others with the same name and different definitions. This is because they will be loaded by name only.

As far as order of execution...#1 is your entry point, if it has dependencies on #2 it will be loaded before any execution, and so on down the line. Unless you did something explicit with your build directives, but you would have run into that already with your current implementations as well.


Viewing latest article 1
Browse Latest Browse All 3

Trending Articles