Type.GetType - can you get the type of an assembly located in a subdirectory?

B

Benny Raymond

I'm working on adding plugin capability to my application and would like
to do it something like this:

System.Type myType = System.Type.GetType( "namespace.classname,
assembly_name" );
object pluginObject = System.Activator.CreateInstance( myType );

this works perfectly fine if the assembly_name.dll file is in the same
directory as the executable, however when I try to move the dll to
\plugins myType ends up being null. I've tried the following different
strings inside of GetType and none have worked:
@"namespace.classname, plugins\assembly_name"
"namespace.classname, plugins\\assembly_name"
@"namespace.classname, plugins/assembly_name"
@"namespace.classname, plugins.assembly_name"

Is it just not possible to get an assembly type outside of the current
folder?

~Benny
 

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

Top