c# - How to force all dlls to add to Current Domain? -
i have solution in c# has 1 main project kingrey (exe) , 1 project called dllreporter , called productreportclasses.
when try list assemblies in exe dllreporter level:
appdomain.currentdomain.getassemblies()
i kingrey , dllreporter, not productreportclasses.
but when di before getting assemblies in main code of kingrey:
productreportclasses.classbasic b = new productreportclasses.classbasic();
and use appdomain.currentdomain.getassemblies() 3 assemblies supposed to.
so question is: how assemblies or force assemblies listed in getassemblies?
simple answer: if a) know assemblies want have loaded in appdomain , 2) know type each assembly can force them loaded doing following
type temp = typeof(classinassemblya); temp = typeof(classinassemblyb); temp = typeof(classinassemblyc);
somewhere near beginning of application's execution. seems bit hacky , is. works (as long qualify , 2 above , reference assemblies a, b , c) , simple do.
Comments
Post a Comment