Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7edeab

Browse files
author
dse
committed
Assembly loading experience improved + fixes.
1 parent9304d72 commite7edeab

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

‎src/runtime/assemblymanager.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ public static Assembly LoadAssembly(string name)
203203
}
204204

205205
PythonEngine.RaiseAssemblyAsModuleImportingEvent(importEvent);
206-
207-
assembly=Assembly.Load(name);
206+
if(!importEvent.SkipAssemblyLoad)
207+
{
208+
assembly=Assembly.Load(name);
209+
}
208210
}
209211
catch(Exception)
210212
{
@@ -351,8 +353,17 @@ internal static void ScanAssembly(Assembly assembly)
351353
// A couple of things we want to do here: first, we want to
352354
// gather a list of all of the namespaces contributed to by
353355
// the assembly.
356+
Type[]types=newType[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+
}
354366

355-
Type[]types=assembly.GetTypes();
356367
foreach(Typetintypes)
357368
{
358369
stringns=t.Namespace??"";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp