diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-01 12:03:26 -0700 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-09 12:59:46 -0700 |
commit | 4ed1a0cb90d85afb4a5c60be4e9f412048c5e187 (patch) | |
tree | b4015ffa0889515097d33efeb46072c053e045b2 /src/vm/assemblyspec.cpp | |
parent | 17ced7fea35cb89ce6fe6c0a614c9fe15171bdea (diff) | |
download | coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.gz coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.bz2 coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.zip |
Fix LoadFromAssemblyName to invoke fallback context (analogous to static assembly loads within the context)
Diffstat (limited to 'src/vm/assemblyspec.cpp')
-rw-r--r-- | src/vm/assemblyspec.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp index 3bd6d38861..2b4b1fb480 100644 --- a/src/vm/assemblyspec.cpp +++ b/src/vm/assemblyspec.cpp @@ -1259,19 +1259,28 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo } #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) + if (GetPreferFallbackLoadContextBinder()) + { + // If we have been asked to use the fallback load context binder (currently only supported for AssemblyLoadContext.LoadFromAssemblyName), + // then pretend we do not have any binder yet available. + _ASSERTE(GetFallbackLoadContextBinderForRequestingAssembly() != NULL); + pParentAssemblyBinder = NULL; + } + if (pParentAssemblyBinder == NULL) { // If the parent assembly binder is not available, then we maybe dealing with one of the following // assembly scenarios: // // 1) Domain Neutral assembly - // 2) RefEmitted assembly - // 3) Entrypoint assembly + // 2) Entrypoint assembly + // 3) RefEmitted assembly + // 4) AssemblyLoadContext.LoadFromAssemblyName // - // For (1) and (3), we will need to bind against the DefaultContext binder (aka TPA Binder). This happens + // For (1) and (2), we will need to bind against the DefaultContext binder (aka TPA Binder). This happens // below if we do not find the parent assembly binder. // - // For (2), check if we have the fallback load context binder for the requesting dynamic assembly available. + // For (3) and (4), fetch the fallback load context binder reference. pParentAssemblyBinder = GetFallbackLoadContextBinderForRequestingAssembly(); } |