Remove Binder assertion for BindByWhereRef
authorAndrew Schwartzmeyer <andschwa@microsoft.com>
Fri, 21 Aug 2015 22:51:23 +0000 (15:51 -0700)
committerAndrew Schwartzmeyer <andschwa@microsoft.com>
Fri, 21 Aug 2015 22:55:06 +0000 (15:55 -0700)
Some use cases of CoreCLR require overriding the assembly load context,
triggering this assertion. However, this override does not necessarily
break support of BindByWhereRef, and so it should be attempted on a
best-effort basis, instead of bailing out prematurely.

src/vm/coreassemblyspec.cpp

index 238e359..1570665 100644 (file)
@@ -176,14 +176,6 @@ VOID  AssemblySpec::Bind(AppDomain      *pAppDomain,
     }
     else
     {
-        // BindByWhereRef is supported only for the default (TPA) Binder in CoreCLR.
-        _ASSERTE(pBinder == pTPABinder);
-        if (pBinder != pTPABinder)
-        {
-            // Fail with an exception for better diagnosis.
-            COMPlusThrowHR(COR_E_INVALIDOPERATION);
-        }
-        
         hr = pTPABinder->Bind(assemblyDisplayName,
                            m_wszCodeBase,
                            GetParentAssembly()? GetParentAssembly()->GetFile():NULL,