I need to look for specific types in all assemblies in a web site or windows app, is there an easy way to do this? Like how the controller factory for ASP.NET MVC looks acr
LINQ solution with check to see if the assembly is dynamic:
///
/// Looks in all loaded assemblies for the given type.
///
///
/// The full name of the type.
///
///
/// The found; null if not found.
///
private static Type FindType(string fullName)
{
return
AppDomain.CurrentDomain.GetAssemblies()
.Where(a => !a.IsDynamic)
.SelectMany(a => a.GetTypes())
.FirstOrDefault(t => t.FullName.Equals(fullName));
}