Type[] types = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IConfigConvert)))) .ToArray(); Assembly assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集 foreach (Type type in types) { string name = type.FullName; IConfigConvert iconvert = (IConfigConvert)assembly.CreateInstance(name); }
标签:Assembly,c#,type,接口,assembly,IConfigConvert,Type,加载 From: https://www.cnblogs.com/robertyao/p/16962829.html