File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 1212using System . Collections ;
1313using System . Collections . Specialized ;
1414using System . Collections . Generic ;
15+ using System . Diagnostics ;
1516using System . Reflection ;
1617using System . Reflection . Emit ;
1718
@@ -57,10 +58,17 @@ internal static void Initialize() {
5758 domain . AssemblyResolve += rhandler ;
5859
5960 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+ }
6472 }
6573 }
6674
@@ -316,9 +324,7 @@ internal static void ScanAssembly(Assembly assembly) {
316324 for ( int n = 0 ; n < names . Length ; n ++ ) {
317325 s = ( n == 0 ) ? names [ 0 ] : s + "." + names [ n ] ;
318326 if ( ! namespaces . ContainsKey ( s ) ) {
319- namespaces . Add ( s ,
320- new Dictionary < Assembly , string > ( )
321- ) ;
327+ namespaces . Add ( s , new Dictionary < Assembly , string > ( ) ) ;
322328 }
323329 }
324330 }
You can’t perform that action at this time.
0 commit comments