specifying an assembly for createInstance

  • Thread starter Thread starter D Yee
  • Start date Start date
D

D Yee

HI all,

So the CF does not support Activator.CreateInstance where you can specify an
assembly. How are you supposed to create an instance that's not in your
assembly?
 
Two ways.
1) Use Assembly.LoadFrom (path) to load the assembly, then Assembly.GetType
to get an instance of type
2) If the assembly is in GAC or already loaded, use
Type.GetType("<typename>, <assemblyname>")

Type tRect = Type.GetType("System.Drawing.Rectangle, System.Drawing");
 

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