File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,10 @@ public static Assembly LoadAssembly(string name)
203
203
}
204
204
205
205
PythonEngine . RaiseAssemblyAsModuleImportingEvent ( importEvent ) ;
206
-
207
- assembly = Assembly . Load ( name ) ;
206
+ if ( ! importEvent . SkipAssemblyLoad )
207
+ {
208
+ assembly = Assembly . Load ( name ) ;
209
+ }
208
210
}
209
211
catch ( Exception )
210
212
{
@@ -351,8 +353,17 @@ internal static void ScanAssembly(Assembly assembly)
351
353
// A couple of things we want to do here: first, we want to
352
354
// gather a list of all of the namespaces contributed to by
353
355
// the assembly.
356
+ Type [ ] types = new Type [ 0 ] ;
357
+ try
358
+ {
359
+ types = assembly . IsDynamic ? assembly . GetTypes ( ) : assembly . GetExportedTypes ( ) ;
360
+ }
361
+ catch ( TypeLoadException )
362
+ {
363
+ // Do nothing.
364
+ // This problem usually occurs when transitive dependencies have references to older packages than main application.
365
+ }
354
366
355
- Type [ ] types = assembly . GetTypes ( ) ;
356
367
foreach ( Type t in types )
357
368
{
358
369
string ns = t . Namespace ?? "" ;
You can’t perform that action at this time.
0 commit comments