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

  • Thread starter Thread starter Benny Raymond
  • Start date Start date
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
 
Back
Top