diff options
author | Jeremy Koritzinsky <jkoritzinsky@gmail.com> | 2019-04-03 04:21:16 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2019-04-03 04:21:16 -0700 |
commit | 5144947b45832e170b2eb3b8f909ec49d7122eaa (patch) | |
tree | f0535e6960747b8d3e9dbfdc32f7aa4b87fcf489 | |
parent | aab338efb65808acc1ff9b7f95bd3dd5f0a6a3be (diff) | |
download | coreclr-5144947b45832e170b2eb3b8f909ec49d7122eaa.tar.gz coreclr-5144947b45832e170b2eb3b8f909ec49d7122eaa.tar.bz2 coreclr-5144947b45832e170b2eb3b8f909ec49d7122eaa.zip |
Treat WinMDs as having been loaded in the default ALC for AssemblyLoadContext.GetLoadContext (#23678)
-rw-r--r-- | src/vm/assemblynative.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index 6cbb8afc17..a7d6863b57 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -1331,7 +1331,14 @@ INT_PTR QCALLTYPE AssemblyNative::GetLoadContextForAssembly(QCall::AssemblyHandl // We should have a load context binder at this point. _ASSERTE(pOpaqueBinder != nullptr); + // the TPA binder uses the default ALC + // WinRT assemblies (bound using the WinRT binder) don't actually have an ALC, + // so treat them the same as if they were loaded into the TPA ALC in this case. +#ifdef FEATURE_COMINTEROP + if (!AreSameBinderInstance(pTPABinder, pOpaqueBinder) && !AreSameBinderInstance(pCurDomain->GetWinRtBinder(), pOpaqueBinder)) +#else if (!AreSameBinderInstance(pTPABinder, pOpaqueBinder)) +#endif // FEATURE_COMINTEROP { // Only CLRPrivBinderAssemblyLoadContext instance contains the reference to its // corresponding managed instance. |