I have a solution in C# that has 1 main project Kingrey (exe) and one project called DllReporter and another called ProductReportClasses.
When I do try to list all assemblies in my exe from DllReporter level:
AppDomain.CurrentDomain.GetAssemblies()
I get only Kingrey and DllReporter, but not ProductReportClasses.
But when I di this before getting assemblies in main code of Kingrey:
ProductReportClasses.ClassBasic b = new ProductReportClasses.ClassBasic();
and than use AppDomain.CurrentDomain.GetAssemblies() than I get all 3 assemblies as supposed to.
So my question is: how to get all assemblies or force all assemblies to be listed in GetAssemblies?
Simple answer: If you A) know all the assemblies you want to have loaded in the appdomain and 2) know a type from each assembly you can force them to be loaded by doing the following
somewhere near the beginning of your application’s execution. This seems a bit hacky and it is. But it works (as long as you qualify for A and 2 above and reference assemblies A, B and C) and is simple to do.