从用户控件中动态加载程序集

Assembly assembly = null;
string windowsPath = Path.Combine(Application.StartupPath, "Windows");
 
foreach (string dllFile in Directory.GetFiles(windowsPath, "*.dll"))
{
     assembly = Assembly.LoadFile(dllFile);
     Type[] types = assembly.GetTypes();
     foreach (Type t in types)
     {
          //增加你的代码
     }
}

结合DesigerHost可以实现类似VS动态加载控件

原文地址:https://www.cnblogs.com/zhaogaojian/p/13363624.html