IsAssignableFrom() returns false when it should return true

That typically happens when there’s a mismatch between the assembly which contains the type IPlugin that the current assembly references, and the assembly which is referenced by the assembly containg the types you’re iterating over.

I suggest you print:

typeof (IPlugin).Module.FullyQualifiedName

and

foreach (var type in t.GetInterfaces ()) 
{    
    Console.WriteLine (type.Module.FullyQualifiedName)
}

To see where the mismatch is.

Leave a Comment