assembly.GetTypes() does not return all types
I try to lead the types from an .dll (which is also referenced in the executing project). I call:
public static void LoadPlugin(string pluginFile)
{
Assembly assembly = Assembly.LoadFrom(pluginFile);
foreach (Type type in assembly.GetTypes())
{
// play with it
}
}
It loads just a few of them:
public partial class Mathematics : UserControl, IMathematics, IPortable
and
public partial class Welcome : UserControl
but the next one, and some others, are ignored:
public partial class Test : UserControl, ITest, IPortable
They all stand in the same assembly, under the same namespace. The public static void LoadPlugin(string pluginFile)
method is located in other assembly that is also referenced in th开发者_如何学JAVAe executing project.
No exceptions are thrown. What could be the issues for not loading all the types? Any ideas?
Are the types not loaded inheriting from a third assembly that isn't referenced correctly from the calling assembly?
精彩评论