c# - Activator.CreateInstance Exception -


dbhandler.idb dbhandler;  filemanager filemanager = filemanager.getfilemanager(); string dbnamespace = filemanager.getdbnamespace(); string dbclassname = filemanager.getdbclassname();  system.reflection.assembly.loadfile(directory.getcurrentdirectory() + "\\" + dbnamespace + ".dll"); debug.writeline("before ___________________________________________________"); objecthandle handle = activator.createinstance(dbnamespace, dbnamespace + "." + dbclassname); dbhandler = (dbhandler.idb)handle.unwrap(); 

in code above i'm getting file name xml configuration file , trying dynamically load correct .dll (this part work fine) , after instantiate class object dbhandler.

after create instance method being called i'm getting exception:

before _______________________________________________
first chance exception of type 'system.io.filenotfoundexception' occurred in mscorlib.dll
first chance exception of type 'system.reflection.targetinvocationexception' occurred in mscorlib.dll
first chance exception of type 'system.reflection.targetinvocationexception' occurred in mscorlib.dll
first chance exception of type 'system.xaml.xamlobjectwriterexception' occurred in system.xaml.dll
first chance exception of type 'system.xaml.xamlobjectwriterexception' occurred in system.xaml.dll

i read somewhere may indicate problem constructor being called, didn't implemented constructor (using default one).


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -