summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vm/assemblynative.cpp7
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.