File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 12
12
using System . Collections ;
13
13
using System . Collections . Specialized ;
14
14
using System . Collections . Generic ;
15
+ using System . Diagnostics ;
15
16
using System . Reflection ;
16
17
using System . Reflection . Emit ;
17
18
@@ -57,10 +58,17 @@ internal static void Initialize() {
57
58
domain . AssemblyResolve += rhandler ;
58
59
59
60
Assembly [ ] items = domain . GetAssemblies ( ) ;
60
- for ( int i = 0 ; i < items . Length ; i ++ ) {
61
- Assembly a = items [ i ] ;
62
- assemblies . Add ( a ) ;
63
- ScanAssembly ( a ) ;
61
+ foreach ( var a in items )
62
+ {
63
+ try
64
+ {
65
+ ScanAssembly ( a ) ;
66
+ assemblies . Add ( a ) ;
67
+ }
68
+ catch ( Exception ex )
69
+ {
70
+ Debug . WriteLine ( string . Format ( "Error scanning assembly {0}. {1}" , a , ex ) ) ;
71
+ }
64
72
}
65
73
}
66
74
@@ -316,9 +324,7 @@ internal static void ScanAssembly(Assembly assembly) {
316
324
for ( int n = 0 ; n < names . Length ; n ++ ) {
317
325
s = ( n == 0 ) ? names [ 0 ] : s + "." + names [ n ] ;
318
326
if ( ! namespaces . ContainsKey ( s ) ) {
319
- namespaces . Add ( s ,
320
- new Dictionary < Assembly , string > ( )
321
- ) ;
327
+ namespaces . Add ( s , new Dictionary < Assembly , string > ( ) ) ;
322
328
}
323
329
}
324
330
}
You can’t perform that action at this time.
0 commit comments