G
Guest
I have an application that gets all the assemblies in a folder structure.
Once I have that list I want to test each assembly to see if it implements a
interface I require. This is what I currently have using C#:
Assembly a = Assembly.LoadFile( file );
Type test = a.GetType( "InterfaceTest.IMyInterface" );
if( test != null )
{
// Valid Assembly for use
// ... do stuff
}
Is there a better to do this? I tried using the types of the assembly and
comparing them to IMyInterface but could not get that to work. I would
really like to do this step with out the type test like above if possible.
Once I have that list I want to test each assembly to see if it implements a
interface I require. This is what I currently have using C#:
Assembly a = Assembly.LoadFile( file );
Type test = a.GetType( "InterfaceTest.IMyInterface" );
if( test != null )
{
// Valid Assembly for use
// ... do stuff
}
Is there a better to do this? I tried using the types of the assembly and
comparing them to IMyInterface but could not get that to work. I would
really like to do this step with out the type test like above if possible.