0

Application A uses assembly B which references assembly C, but C is actually never used at runtime in A. Can C be safely omitted from the installer for A?

It seems C is never loaded, so there should be no problem. Does the CLR guarantee when an assembly will (not) be loaded? Are there any other hidden traps?

Diagram of A, B and C


Similar question 1 mentions some books and MSDN magazines that claim there are ways to avoid loading assemblies.

Similar question 2 on the other hand claims it is not deterministic.

Is there an authorative source of information (e.g. MSDN documentation or CLR specification, etc.) that can be used to back up either claim?

Community
  • 1
  • 1
Peter
  • 3,322
  • 3
  • 27
  • 41
  • 1
    You can, but if B ever tires to use anything in C you'll get a FileNotFoundException. –  Aug 20 '15 at 15:27
  • 1
    Peter: can you please tell me how you made sure that C is never being used at runtime? – Isaiah4110 Aug 21 '15 at 13:15
  • @Isaiah44110: Let's say C provides an interface to a database, and B supports that but A actually can not be used with a database. So it's obvious C does not get used in A. – Peter Aug 22 '15 at 16:03

0 Answers0