CSharp examples for System.Reflection:Assembly
Get Types Safely from Assembly
using System.Reflection; using System.Linq; using System.Collections.Generic; using System;//from w w w . ja v a2 s. co m public class Main{ public static IEnumerable<Type> GetTypesSafely(this Assembly assembly) { try { return assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { return ex.Types.Where(x => x != null); } } }