One of my current employer products retrieves a list of all the DLLs from the login assembly directory. Then it loads them all using Assembly.LoadFrom . He does this while the splash screen does not work. Honestly, the code scares me. We had to introduce some hacks to avoid certain DLLs. We had to change the installer to clear the target directory before the update. This is a very unsafe plan.
In my previous assignment, I wrote a similar function that used the GetReferencedAssemblies method. Starting with the input assembly, it calls this recursively, and then Assembly.LoadFrom . This would stop recursion after it loaded an assembly that was not shipped with our product. It worked, but since then I decided it wasn’t necessary.
In the current product I'm working on, we use Autofac to create a complete dependency tree for the application. The bootstrapper code for the configuration, which refers to all the services in the entire project - I would assume that at least 70% of the code. Again, this works while the splash screen does not work. This is the right approach. He balances "loading essentials," "taking the time to download everything, including material that can never be used."
source share