c# - Using Reflection when an assembly contains types referencing another assembly -


i getting reflectiontypeloadexception following code :

var myassembly = assembly.loadfrom(mydll);     var types = myassembly.gettypes()) 

mydll references class in file in other assembly ("mydependency.dll")
made sure file resides in application directory , in same folder "mydll" file.

how able load mydll in case ?

i'd try calling:

assemblyname[] referenced = myassembly.getreferencedassemblies(); 

then iterate on assemblyname objects , attempt load those, prior calling myassembly.gettypes()


Comments