Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit f2321b7

Browse files
authored
Merge pull request #9320 from gkhanna79/Fix9030_111
Use fallback load context when dynamic assembly triggers load
2 parents 6e1bb78 + 94ed316 commit f2321b7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/vm/assemblyspec.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,15 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
12561256

12571257
// ICLRPrivAssembly implements ICLRPrivBinder and thus, "is a" binder in a manner of semantics.
12581258
pParentAssemblyBinder = pParentPEAssembly->GetBindingContext();
1259+
if (pParentAssemblyBinder == NULL)
1260+
{
1261+
if (pParentPEAssembly->IsDynamic())
1262+
{
1263+
// If the parent assembly is dynamically generated, then use its fallback load context
1264+
// as the binder.
1265+
pParentAssemblyBinder = pParentPEAssembly->GetFallbackLoadContextBinder();
1266+
}
1267+
}
12591268
}
12601269

12611270
#if defined(FEATURE_HOST_ASSEMBLY_RESOLVER)

0 commit comments

Comments
 (0)