Assembly.GetTypes () doesn't return all types
I'm trying to cast types from .dll (which is also mentioned in the executable project). I'm calling:
public static void LoadPlugin(string pluginFile)
{
Assembly assembly = Assembly.LoadFrom(pluginFile);
foreach (Type type in assembly.GetTypes())
{
// play with it
}
}
It only downloads a few of them:
public partial class Mathematics : UserControl, IMathematics, IPortable
and
public partial class Welcome : UserControl
but the following and some others are ignored:
public partial class Test : UserControl, ITest, IPortable
They are all in the same assembly, in the same namespace. The method public static void LoadPlugin(string pluginFile)
is in another assembly that is also mentioned in the executable project.
No exceptions are thrown. What problems can there be when loading all types? Any ideas?
+2
a source to share