简体   繁体   中英

What happens when a strong named assembly that depends on private assemblies is installed in GAC

If strong named assembly 'A' depends on private assemblies 'B' and 'C'. When I use 'gacutil.exe' to install A in GAC, what happens to B and C? I couldn't see them in the folder in GAC directory. Will it still refer to B and C location, ie if B and C are in Debug folder (in the same directory of A) prior to deployment, will A absolutely refer to B and C after installing 'A' in GAC?

Folder Debug:-

    A.dll
    B.dll
    C.dll
    main.exe

say, main.exe runs perfectly now and that I install it on another machine, main.exe will not work if A is not present, so I also install A in the target machine's GAC. but how should I do that? when I use gacutil, it doesn't copy B and C to A's directory in GAC?

It is perfectly valid to have assembly that depends on some other assemblies to be installed that way (A in the GAC, dependencies are either loaded by app or not present at all). Ie A can provide some way (or automatically) to disable features if referenced assemblies can't be loaded.

If you know that all 3 assemblies should be installed in the GAC it is your responsibility to do so via your setup.

Note that GacUtil is not re-disitributable tool - even if it does not help you with local install (as it does not automatically install dependencies) it does not really help you with installing on other machines (assuming you care about rules). See What's the 'correct' way of registering/installing an Assembly to the GAC?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM