c# - Unknown exception or error on Assembly.GetTypes during runtime -


i have following code in project , works fine on machine when run on testing machine crashes on method plugin.gettypes(). assembly loaded though.

directoryinfo di = new directoryinfo(path); var files = di.getfiles(dllname, searchoption.topdirectoryonly); foreach (var file in files) {         assembly plugin = assembly.loadfrom(file.fullname);         try         {            foreach (type plugintype in plugin.gettypes()) {             // dealing plugintypes...            }         }         catch (exception ex) {            messagebox.show(ex.message);          } } 

problem don't have option debug code visual studio there. tried simply

try {     var temp = plugin.gettypes(); } catch (exception ex) {     messagebox.show(ex.message); } 

but never catches exception, crash. on machine use same full debug folder run app.

it seems problem 1 reference wasn't set copylocal. hellix 88.


Comments