private static bool ShouldExclude(TypeDef type, IDnlibDef def) { foreach (var constructor in type.FindInstanceConstructors()) { if (constructor.Parameters.Count > 1 && constructor.Parameters.Skip(1).First().Type.TypeName == "IHostingEnvironment") { // Found the Startup class return(true); } } if (type.BaseType?.FullName == "Microsoft.AspNetCore.Mvc.Controller") { // Found an AspNetCore MVC controller return(true); } return(false); }