File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,10 +147,22 @@ protected virtual Assembly[] GetAssembliesToScan(ConventionData data)
147147 protected virtual Type [ ] GetTypesToTest ( ConventionData data )
148148 {
149149 return
150- GetAssembliesToScan ( data ) . SelectMany ( a => a . GetTypes ( ) ) . Where ( data . Types . Invoke ) . OrderBy ( t => t . FullName )
151- . ToArray ( ) ;
152- }
153- }
150+ GetAssembliesToScan ( data ) . SelectMany ( GetTypesSafely ) . Where ( data . Types . Invoke ) . OrderBy ( t => t . FullName )
151+ . ToArray ( ) ;
152+ }
153+
154+ private static IEnumerable < Type > GetTypesSafely ( Assembly assembly )
155+ {
156+ try
157+ {
158+ return assembly . GetTypes ( ) ;
159+ }
160+ catch ( ReflectionTypeLoadException ex )
161+ {
162+ return ex . Types . Where ( x => x != null ) ;
163+ }
164+ }
165+ }
154166
155167 public abstract class WindsorConventionTest < TDiagnostic > : WindsorConventionTest < TDiagnostic , IHandler >
156168 where TDiagnostic : class , IDiagnostic < IEnumerable < IHandler > > , IDiagnostic < object >
You can’t perform that action at this time.
0 commit comments