reflection: invoke constructor, properties have "<error: an exception

D

Daniel

hi ng,

i want to invoke a dynamically created object with reflection, like:


public static object createInstance(string classname, string assemblyName)
{
object obj=null;
Assembly assembly=
Assembly.LoadFile(AppSettings.Root+@"bin\"+assemblyName);
obj=assembly.CreateInstance(classname);
return obj;
}

what happens is that all the properties of the object show a

<error: an exception of type: {System.ArgumentException} occurred> string

in the debugger.
whereas the prtivate fields have the correct null value.
what is wrong there?
i don't get it.

thank you very much for your help!

dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top