internal static void Register(ITypeContext context, string lib, INodeList <TypeImport> imports) { #if NETCOREAPP // todo not supported getTypes for netcoreapp var assemblyImport = Assembly.Load(lib); #else var assemblyImport = Assembly.ReflectionOnlyLoad(lib); #endif foreach (var import in imports) { TypeName typeName = import.TypeName; Type type; if (typeName.Namespace == null) { Type[] types = assemblyImport.GetExportedTypes(); type = types.FirstOrDefault(t => t.Name == typeName.Name); } else { type = assemblyImport.GetType(typeName.FullName); } context.Register(import.Name, type); } }