C# reflection

  • Thread starter Thread starter jianhua.he
  • Start date Start date
J

jianhua.he

I am working on an application in C#, it will load another managed
code library DLL in runtime, instead of write the following code:

Assembly asmb =
Assembly.LoadFrom("C:\\test\\AssemblyTest1\AssemblyTest1.dll");

object test = asmb.CreateInstance("AssemblyTest1.Test",
false, BindingFlags.CreateInstance, null, null,
CultureInfo.CurrentCulture, null);
....

I would like to write:

Assembly asmb =
Assembly.LoadFrom("C:\\test\\AssemblyTest1\AssemblyTest1.dll");

....

AssemblyTest1.Test test = new AssemblyTest1.Test();

How should I do this?

Thanks in advance
 

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

Back
Top