How to prevent ReflectionTypeLoadException when calling Assembly.GetTypes()
One fairly nasty way would be: Type[] types; try { types = asm.GetTypes(); } catch (ReflectionTypeLoadException e) { types = e.Types; } foreach (var t in types.Where(t => t != null)) { … } It’s definitely annoying to have to do this though. You could use an extension method to make it nicer in the … Read more