.Net runtime does not load assemblies for entertainment. He does this only when necessary, i.e. You are actively using the class / methods from this assembly. You can even reference assemblies that are missing if the code that uses them does not execute.
Therefore, preventing the assembly from loading will not make your application work - that is, remove the assembly and see how your application crashes due to lack of dependency.
If you yourself download the assemblies yourself (for example, Assembly.Load), than you need to figure out how to skip such assemblies ...
source share