Remove never defined FEATURE_REFLECTION_ONLY_LOAD
authordanmosemsft <danmose@microsoft.com>
Wed, 15 Feb 2017 05:34:56 +0000 (21:34 -0800)
committerdanmosemsft <danmose@microsoft.com>
Wed, 15 Feb 2017 05:48:43 +0000 (21:48 -0800)
15 files changed:
clr.defines.targets
clr.props
src/mscorlib/src/System/AppDomain.cs
src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs
src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs
src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
src/vm/appdomain.cpp
src/vm/appdomain.hpp
src/vm/assemblynative.cpp
src/vm/assemblyspec.cpp
src/vm/ceeload.cpp
src/vm/ecalllist.h
src/vm/mscorlib.cpp
src/vm/mscorlib.h
src/vm/object.h

index 61ee17a..9ed5603 100644 (file)
@@ -57,7 +57,6 @@
         <CDefines Condition="'$(FeaturePerfmon)' == 'true'">$(CDefines);FEATURE_PERFMON</CDefines>
         <CDefines Condition="'$(FeaturePrejit)' == 'true'">$(CDefines);FEATURE_PREJIT</CDefines>
         <CDefines Condition="'$(FeatureRandomizedStringHashing)' == 'true'">$(CDefines);FEATURE_RANDOMIZED_STRING_HASHING</CDefines>
-        <CDefines Condition="'$(FeatureReflectionOnlyLoad)' == 'true'">$(CDefines);FEATURE_REFLECTION_ONLY_LOAD</CDefines>
         <CDefines Condition="'$(FeatureReJIT)' == 'true'">$(CDefines);FEATURE_REJIT</CDefines>
         <CDefines Condition="'$(FeatureRemoting)' == 'true'">$(CDefines);FEATURE_REMOTING</CDefines>
         <CDefines Condition="'$(FeatureSortTables)' == 'true'">$(CDefines);FEATURE_SORT_TABLES</CDefines>
         <DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
         <DefineConstants Condition="'$(FeaturePerfmon)' == 'true'">$(DefineConstants);FEATURE_PERFMON</DefineConstants>
         <DefineConstants Condition="'$(FeatureRandomizedStringHashing)' == 'true'">$(DefineConstants);FEATURE_RANDOMIZED_STRING_HASHING</DefineConstants>
-        <DefineConstants Condition="'$(FeatureReflectionOnlyLoad)' == 'true'">$(DefineConstants);FEATURE_REFLECTION_ONLY_LOAD</DefineConstants>
         <DefineConstants Condition="'$(FeatureRemoting)' == 'true'">$(DefineConstants);FEATURE_REMOTING</DefineConstants>
         <DefineConstants Condition="'$(FeatureSortTables)' == 'true'">$(DefineConstants);FEATURE_SORT_TABLES</DefineConstants>
         <DefineConstants Condition="'$(FeatureTypeEquivalence)' == 'true'">$(DefineConstants);FEATURE_TYPEEQUIVALENCE</DefineConstants>
index b1d3618..e6169d1 100644 (file)
--- a/clr.props
+++ b/clr.props
     <FeatureMdaSupported>false</FeatureMdaSupported>
     <FeatureMergeJitAndEngine>true</FeatureMergeJitAndEngine>
     <FeatureRandomizedStringHashing>false</FeatureRandomizedStringHashing>
-    <FeatureReflectionOnlyLoad>false</FeatureReflectionOnlyLoad>
     <FeatureStackProbe>false</FeatureStackProbe>
     <FeatureReJIT>false</FeatureReJIT>
     <FeatureVersioningLog>false</FeatureVersioningLog>
index 8e66871..c6fa7d4 100644 (file)
@@ -246,9 +246,6 @@ namespace System
             }
         }
 
-#if FEATURE_REFLECTION_ONLY_LOAD
-        public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
-#endif // FEATURE_REFLECTION_ONLY
 
         private ApplicationTrust _applicationTrust;
         private EventHandler     _processExit;
@@ -656,53 +653,6 @@ namespace System
             }
         }
 
-#if FEATURE_REFLECTION_ONLY_LOAD
-        private Assembly ResolveAssemblyForIntrospection(Object sender, ResolveEventArgs args)
-        {
-            Contract.Requires(args != null);
-            return Assembly.ReflectionOnlyLoad(ApplyPolicy(args.Name));
-        }
-        
-        // Helper class for method code:EnableResolveAssembliesForIntrospection
-        private class NamespaceResolverForIntrospection
-        {
-            private IEnumerable<string> _packageGraphFilePaths;
-            public NamespaceResolverForIntrospection(IEnumerable<string> packageGraphFilePaths)
-            {
-                _packageGraphFilePaths = packageGraphFilePaths;
-            }
-            
-            public void ResolveNamespace(
-                object sender, 
-                System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs args)
-            {
-                Contract.Requires(args != null);
-                
-                IEnumerable<string> fileNames = System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ResolveNamespace(
-                    args.NamespaceName,
-                    null,   // windowsSdkFilePath ... Use OS installed .winmd files
-                    _packageGraphFilePaths);
-                foreach (string fileName in fileNames)
-                {
-                    args.ResolvedAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(fileName));
-                }
-            }
-        }
-        
-        // Called only by native function code:ValidateWorker
-        private void EnableResolveAssembliesForIntrospection(string verifiedFileDirectory)
-        {
-            CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(ResolveAssemblyForIntrospection);
-            
-            string[] packageGraphFilePaths = null;
-            if (verifiedFileDirectory != null)
-                packageGraphFilePaths = new string[] { verifiedFileDirectory };
-            NamespaceResolverForIntrospection namespaceResolver = new NamespaceResolverForIntrospection(packageGraphFilePaths);
-            
-            System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve += 
-                new EventHandler<System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs>(namespaceResolver.ResolveNamespace);
-        }
-#endif // FEATURE_REFLECTION_ONLY_LOAD
 
         public ObjectHandle CreateInstance(String assemblyName,
                                            String typeName)
index 3deef21..8ab5088 100644 (file)
@@ -242,9 +242,6 @@ namespace System.Reflection.Emit
                 throw new ArgumentNullException(nameof(name));
 
             if (access != AssemblyBuilderAccess.Run
-#if FEATURE_REFLECTION_ONLY_LOAD
-                && access != AssemblyBuilderAccess.ReflectionOnly
-#endif // FEATURE_REFLECTION_ONLY_LOAD
                 && access != AssemblyBuilderAccess.RunAndCollect
                 )
             {
index b3d1711..e52135e 100644 (file)
@@ -14,9 +14,6 @@ namespace System.Reflection.Emit
     public enum AssemblyBuilderAccess
     {
         Run = 1,
-#if FEATURE_REFLECTION_ONLY_LOAD
-        ReflectionOnly = 6, // 4 | Save,
-#endif // FEATURE_REFLECTION_ONLY_LOAD
         RunAndCollect = 8 | Run
     }
 }
index f097c6a..429112c 100644 (file)
@@ -57,45 +57,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
         }
     }
     
-#if FEATURE_REFLECTION_ONLY_LOAD
-    public class NamespaceResolveEventArgs : EventArgs
-    {
-        private string _NamespaceName;
-        private Assembly _RequestingAssembly;
-        private Collection<Assembly> _ResolvedAssemblies;
-
-        public string NamespaceName
-        {
-            get
-            {
-                return _NamespaceName;
-            }
-        }
-
-        public Assembly RequestingAssembly
-        {
-            get
-            {
-                return _RequestingAssembly;
-            }
-        }
-
-        public Collection<Assembly> ResolvedAssemblies
-        {
-            get
-            {
-                return _ResolvedAssemblies;
-            }
-        }
-        
-        public NamespaceResolveEventArgs(string namespaceName, Assembly requestingAssembly)
-        {
-            _NamespaceName = namespaceName;
-            _RequestingAssembly = requestingAssembly;
-            _ResolvedAssemblies = new Collection<Assembly>();
-        }
-    }
-#endif //FEATURE_REFLECTION_ONLY
 
     internal class DesignerNamespaceResolveEventArgs : EventArgs
     {
index 3b4be97..a02e9ed 100644 (file)
@@ -4212,10 +4212,6 @@ AppDomain::AppDomain()
 #endif // FEATURE_TYPEEQUIVALENCE
 
 #ifdef FEATURE_COMINTEROP
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    m_pReflectionOnlyWinRtBinder = NULL;
-    m_pReflectionOnlyWinRtTypeCache = NULL;
-#endif // FEATURE_REFLECTION_ONLY_LOAD
     m_pNameToTypeMap = NULL;
     m_vNameToTypeMapVersion = 0;
     m_nEpoch = 0;
@@ -4278,16 +4274,6 @@ AppDomain::~AppDomain()
 #endif //  FEATURE_REMOTING
 
 #ifdef FEATURE_COMINTEROP
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    if (m_pReflectionOnlyWinRtBinder != NULL)
-    {
-        m_pReflectionOnlyWinRtBinder->Release();
-    }
-    if (m_pReflectionOnlyWinRtTypeCache != NULL)
-    {
-        m_pReflectionOnlyWinRtTypeCache->Release();
-    }
-#endif // FEATURE_REFLECTION_ONLY_LOAD
     if (m_pNameToTypeMap != nullptr)
     {
         delete m_pNameToTypeMap;
@@ -4461,10 +4447,6 @@ void AppDomain::Init()
 #ifdef FEATURE_COMINTEROP
     if (!AppX::IsAppXProcess())
     {
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-        m_pReflectionOnlyWinRtTypeCache = clr::SafeAddRef(new CLRPrivTypeCacheReflectionOnlyWinRT());
-        m_pReflectionOnlyWinRtBinder = clr::SafeAddRef(new CLRPrivBinderReflectionOnlyWinRT(m_pReflectionOnlyWinRtTypeCache));
-#endif
     }
 #endif //FEATURE_COMINTEROP
 
@@ -7327,63 +7309,6 @@ EndTry2:;
         HRESULT hrBindResult = S_OK;
         PEAssemblyHolder result;
         
-#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD)
-        // We want to keep this holder around to avoid closing and remapping the file again - calls to Fusion further down will open the file again
-        ReleaseHolder<IMetaDataAssemblyImport> pMetaDataAssemblyImport;
-        
-        // Special case ReflectionOnlyLoadFrom on .winmd (WinRT) assemblies
-        if (pSpec->IsIntrospectionOnly() && (pSpec->m_wszCodeBase != NULL))
-        {   // This is a LoadFrom request - we need to find out if it is .winmd file or classic managed assembly
-            HRESULT hr = S_OK;
-            
-            StackSString sPath(pSpec->GetCodeBase());
-            PEAssembly::UrlToPath(sPath);
-            
-            // Open MetaData of the file
-            hr = GetAssemblyMDInternalImportEx(
-                sPath, 
-                IID_IMetaDataAssemblyImport, 
-                MDInternalImport_Default, 
-                (IUnknown **)&pMetaDataAssemblyImport);
-            if (SUCCEEDED(hr))
-            {
-                DWORD dwAssemblyFlags = 0;
-                hr = pMetaDataAssemblyImport->GetAssemblyProps(
-                    TokenFromRid(1, mdtAssembly), 
-                    nullptr,    // ppbPublicKey
-                    nullptr,    // pcbPublicKey
-                    nullptr,    // pulHashAlgId
-                    nullptr,    // szName
-                    0,          // cchName
-                    nullptr,    // pchName
-                    nullptr,    // pMetaData
-                    &dwAssemblyFlags);
-                if (SUCCEEDED(hr) && IsAfContentType_WindowsRuntime(dwAssemblyFlags))
-                {   // It is .winmd file
-                    _ASSERTE(!AppX::IsAppXProcess());
-                    
-                    ReleaseHolder<ICLRPrivAssembly> pPrivAssembly;
-                    ReleaseHolder<PEAssembly> pAssembly;
-
-                    hr = m_pReflectionOnlyWinRtBinder->BindAssemblyExplicit(sPath, &pPrivAssembly);
-                    if (SUCCEEDED(hr))
-                    {
-                        hr = BindHostedPrivAssembly(nullptr, pPrivAssembly, nullptr, &pAssembly, TRUE);
-                        _ASSERTE(FAILED(hr) || (pAssembly != nullptr));
-                    }
-                    if (FAILED(hr))
-                    {
-                        if (fThrowOnFileNotFound)
-                        {
-                            ThrowHR(hr);
-                        }
-                        return nullptr;
-                    }
-                    return pAssembly.Extract();
-                }
-            }
-        }
-#endif //FEATURE_COMINTEROP && FEATURE_REFLECTION_ONLY_LOAD
 
         EX_TRY
         {
@@ -7427,28 +7352,6 @@ EndTry2:;
                     if (fAddFileToCache)
                     {
 
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-                        // <TODO> PERF: This doesn't scale... </TODO>
-                        if (pSpec->IsIntrospectionOnly() && (pSpec->GetCodeBase() != NULL))
-                        {
-                            IAssemblyName * pIAssemblyName = result->GetFusionAssemblyName();
-
-                            AppDomain::AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)(
-                                kIncludeLoaded | kIncludeIntrospection));
-                            CollectibleAssemblyHolder<DomainAssembly *> pCachedDomainAssembly;
-                            while (i.Next(pCachedDomainAssembly.This()))
-                            {
-                                IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName();
-                                if (pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL) == S_OK)
-                                {
-                                    if (!pCachedDomainAssembly->GetAssembly()->GetManifestModule()->GetFile()->Equals(result))
-                                    {
-                                        COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFROM, pSpec->GetCodeBase());
-                                    }
-                                }
-                            }
-                        }
-#endif //FEATURE_REFLECTION_ONLY_LOAD
 
                         if (pSpec->CanUseWithBindingCache() && result->CanUseWithBindingCache())
                         {
@@ -7614,139 +7517,6 @@ EndTry2:;
 } // AppDomain::BindAssemblySpec
 
 
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-DomainAssembly * 
-AppDomain::BindAssemblySpecForIntrospectionDependencies(
-    AssemblySpec * pSpec)
-{
-    STANDARD_VM_CONTRACT;
-    
-    PRECONDITION(CheckPointer(pSpec));
-    PRECONDITION(pSpec->GetAppDomain() == this);
-    PRECONDITION(pSpec->IsIntrospectionOnly());
-    PRECONDITION(this == ::GetAppDomain());
-    
-    PEAssemblyHolder result;
-    HRESULT hr;
-    
-    if (!pSpec->HasUniqueIdentity())
-    {
-        if (!pSpec->HasBindableIdentity())
-        {
-            COMPlusThrowHR(E_UNEXPECTED);
-        }
-        
-        // In classic (non-AppX), this is initilized by AppDomain constructor
-        _ASSERTE(m_pReflectionOnlyWinRtBinder != NULL);
-        
-        ReleaseHolder<ICLRPrivAssembly> pPrivAssembly;
-        hr = m_pReflectionOnlyWinRtBinder->BindWinRtType(
-            pSpec->GetWinRtTypeNamespace(), 
-            pSpec->GetWinRtTypeClassName(), 
-            pSpec->GetParentAssembly(), 
-            &pPrivAssembly);
-        if (FAILED(hr))
-        {
-            if (hr == CLR_E_BIND_TYPE_NOT_FOUND)
-            {   // We could not find the type - throw TypeLoadException to give user type name for diagnostics
-                EX_THROW(EETypeLoadException, (pSpec->GetWinRtTypeNamespace(), pSpec->GetWinRtTypeClassName(), nullptr, nullptr, IDS_EE_REFLECTIONONLY_WINRT_LOADFAILURE));
-            }
-            if (!Exception::IsTransient(hr))
-            {   // Throw the HRESULT as exception wrapped by TypeLoadException to give user type name for diagnostics
-                EEMessageException ex(hr);
-                EX_THROW_WITH_INNER(EETypeLoadException, (pSpec->GetWinRtTypeNamespace(), pSpec->GetWinRtTypeClassName(), nullptr, nullptr, IDS_EE_REFLECTIONONLY_WINRT_LOADFAILURE), &ex);
-            }
-            IfFailThrow(hr);
-        }
-        
-        IfFailThrow(BindHostedPrivAssembly(nullptr, pPrivAssembly, nullptr, &result, TRUE));
-        _ASSERTE(result != nullptr);
-        return LoadDomainAssembly(pSpec, result, FILE_LOADED);
-    }
-    
-    EX_TRY
-    {
-        if (!IsCached(pSpec))
-        {
-            result = TryResolveAssembly(pSpec, TRUE /*fPreBind*/);
-            if (result != NULL && result->CanUseWithBindingCache())
-            {
-                // Failure to add simply means someone else beat us to it. In that case
-                // the FindCachedFile call below (after catch block) will update result
-                // to the cached value.
-                AddFileToCache(pSpec, result, TRUE /*fAllowFailure*/);
-            }
-        }
-    }
-    EX_CATCH
-    {
-        Exception *ex = GET_EXCEPTION();
-        AssemblySpec NewSpec(this);
-        AssemblySpec *pFailedSpec = NULL;
-
-        // Let transient exceptions propagate
-        if (ex->IsTransient())
-        {
-            EX_RETHROW;
-        }
-
-        // Non-"file not found" exception also propagate
-        BOOL fFailure = PostBindResolveAssembly(pSpec, &NewSpec, ex->GetHR(), &pFailedSpec);
-        if(fFailure)
-        {
-            if (AddExceptionToCache(pFailedSpec, ex))
-            {
-                if ((pFailedSpec == pSpec) && EEFileLoadException::CheckType(ex))
-                {
-                    EX_RETHROW; //preserve the information
-                }
-                else
-                    EEFileLoadException::Throw(pFailedSpec, ex->GetHR(), ex);
-            }
-        }
-    }
-    EX_END_CATCH(RethrowTerminalExceptions);
-
-    result = FindCachedFile(pSpec);
-    result.SuppressRelease();
-
-
-    if (result)
-    {
-        // It was either already in the spec cache or the prebind event returned a result.
-        return LoadDomainAssembly(pSpec, result, FILE_LOADED);
-    }
-
-
-    // Otherwise, look in the list of assemblies already loaded for reflectiononly.
-    IAssemblyName * ptmp = NULL;
-    hr = pSpec->CreateFusionName(&ptmp);
-    if (FAILED(hr))
-    {
-        COMPlusThrowHR(hr);
-    }
-    SafeComHolder<IAssemblyName> pIAssemblyName(ptmp);
-
-    // Note: We do not support introspection-only collectible assemblies (yet)
-    AppDomain::AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)(
-        kIncludeLoaded | kIncludeIntrospection | kExcludeCollectible));
-    CollectibleAssemblyHolder<DomainAssembly *> pCachedDomainAssembly;
-    
-    while (i.Next(pCachedDomainAssembly.This()))
-    {
-        _ASSERTE(!pCachedDomainAssembly->IsCollectible());
-        IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName();
-        if (pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL) == S_OK)
-        {
-            return pCachedDomainAssembly;
-        }
-    }
-    // If not found in that list, it is an ERROR. Yes, this is by design.
-    StackSString name;
-    pSpec->GetFileOrDisplayName(0, name);
-    COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFAILURE,name);
-} // AppDomain::BindAssemblySpecForIntrospectionDependencies
-#endif // FEATURE_REFLECTION_ONLY_LOAD
 
 PEAssembly *AppDomain::TryResolveAssembly(AssemblySpec *pSpec, BOOL fPreBind)
 {
@@ -10561,25 +10331,6 @@ AppDomain::RaiseAssemblyResolveEvent(
     StackSString ssName;
     pSpec->GetFileOrDisplayName(0, ssName);
     
-#ifdef FEATURE_REFLECTION_ONLY_LOAD    
-    if ( (!fIntrospection) && (!fPreBind) )
-    {
-        methodId = METHOD__APP_DOMAIN__ON_ASSEMBLY_RESOLVE;  // post-bind execution event (the classic V1.0 event)
-    }
-    else if ((!fIntrospection) && fPreBind)
-    {
-        RETURN NULL; // There is currently no prebind execution resolve event
-    }
-    else if (fIntrospection && !fPreBind)
-    {
-        RETURN NULL; // There is currently no post-bind introspection resolve event
-    }
-    else
-    {
-        _ASSERTE( fIntrospection && fPreBind );
-        methodId = METHOD__APP_DOMAIN__ON_REFLECTION_ONLY_ASSEMBLY_RESOLVE; // event for introspection assemblies
-    }
-#else // FEATURE_REFLECTION_ONLY_LOAD
     if (!fPreBind) 
     {
         methodId = METHOD__APP_DOMAIN__ON_ASSEMBLY_RESOLVE;  // post-bind execution event (the classic V1.0 event)
@@ -10589,7 +10340,6 @@ AppDomain::RaiseAssemblyResolveEvent(
         RETURN NULL;
     }
         
-#endif // FEATURE_REFLECTION_ONLY_LOAD
 
     // Elevate threads allowed loading level.  This allows the host to load an assembly even in a restricted
     // condition.  Note, however, that this exposes us to possible recursion failures, if the host tries to
index c0d3bf1..525d934 100644 (file)
@@ -2485,9 +2485,6 @@ public:
         PEAssembly **      ppAssembly, 
         BOOL               fIsIntrospectionOnly = FALSE) DAC_EMPTY_RET(S_OK);
 
-#ifdef FEATURE_REFLECTION_ONLY_LOAD    
-    virtual DomainAssembly *BindAssemblySpecForIntrospectionDependencies(AssemblySpec *pSpec) DAC_EMPTY_RET(NULL);
-#endif
 
     PEAssembly *TryResolveAssembly(AssemblySpec *pSpec, BOOL fPreBind);
 
@@ -3832,11 +3829,6 @@ public:
 #ifdef FEATURE_COMINTEROP
 
 private:
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    // ReflectionOnly WinRT binder and its TypeCache (only in classic = non-AppX; the scenario is not supported in AppX)
-    CLRPrivBinderReflectionOnlyWinRT *    m_pReflectionOnlyWinRtBinder;
-    CLRPrivTypeCacheReflectionOnlyWinRT * m_pReflectionOnlyWinRtTypeCache;
-#endif // FEATURE_REFLECTION_ONLY_LOAD
 
 #endif //FEATURE_COMINTEROP
 
index 0a303bf..c9a15d3 100644 (file)
@@ -313,26 +313,6 @@ Assembly* AssemblyNative::LoadFromBuffer(BOOL fForIntrospection, const BYTE* pAs
     // This applies to both Desktop CLR and CoreCLR, with or without fusion.
     BOOL fIsSameAssembly = (pAssembly->GetManifestFile()->GetILimage() == pFile->GetILimage());
 
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    if (fForIntrospection)
-    {
-        IAssemblyName * pIAssemblyName = pAssembly->GetFusionAssemblyName();
-
-        AppDomain::AssemblyIterator i = GetAppDomain()->IterateAssembliesEx(
-            (AssemblyIterationFlags)(kIncludeLoaded | kIncludeIntrospection));
-        CollectibleAssemblyHolder<DomainAssembly *> pDomainAssembly;
-        
-        while (i.Next(pDomainAssembly.This()))
-        {
-            Assembly * pCachedAssembly = pDomainAssembly->GetAssembly();
-            IAssemblyName * pCachedAssemblyName = pCachedAssembly->GetFusionAssemblyName();
-            if ((pAssembly != pCachedAssembly) && (S_OK == pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL)))
-            {
-                COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFROM, W("")); //@todo: need to fill in assemblyname
-            }
-        }
-    }
-#endif // FEATURE_REFLECTION_ONLY_LOAD    
 
     LOG((LF_CLASSLOADER, 
          LL_INFO100, 
index b60f957..b969e8d 100644 (file)
@@ -921,28 +921,6 @@ DomainAssembly *AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel,
         RETURN pAssembly;
     }
 
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    if (IsIntrospectionOnly() && (GetCodeBase() == NULL))
-    {
-        SafeComHolder<IAssemblyName> pIAssemblyName;
-        IfFailThrow(CreateFusionName(&pIAssemblyName));
-
-        // Note: We do not support introspection-only collectible assemblies (yet)
-        AppDomain::AssemblyIterator i = pDomain->IterateAssembliesEx(
-            (AssemblyIterationFlags)(kIncludeLoaded | kIncludeIntrospection | kExcludeCollectible));
-        CollectibleAssemblyHolder<DomainAssembly *> pCachedDomainAssembly;
-
-        while (i.Next(pCachedDomainAssembly.This()))
-        {
-            _ASSERTE(!pCachedDomainAssembly->IsCollectible());
-            IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName();
-            if (S_OK == pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL))
-            {
-                RETURN pCachedDomainAssembly;
-            }
-        }
-    }
-#endif // FEATURE_REFLECTION_ONLY_LOAD
 
     PEAssemblyHolder pFile(pDomain->BindAssemblySpec(this, fThrowOnFileNotFound, fRaisePrebindEvents, pCallerStackMark, pLoadSecurity));
     if (pFile == NULL)
index f90e06f..7ff6c38 100644 (file)
@@ -5652,22 +5652,6 @@ DomainAssembly * Module::LoadAssembly(
 
     bool fHasBindableIdentity = HasBindableIdentity(kAssemblyRef);
     
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    if (IsIntrospectionOnly())
-    {
-        // We will not get here on GC thread
-        GCX_PREEMP();
-        
-        AssemblySpec spec;
-        spec.InitializeSpec(kAssemblyRef, GetMDImport(), GetDomainFile(GetAppDomain())->GetDomainAssembly(), IsIntrospectionOnly());
-        if (szWinRtTypeClassName != NULL)
-        {
-            spec.SetWindowsRuntimeType(szWinRtTypeNamespace, szWinRtTypeClassName);
-        }
-        pDomainAssembly = GetAppDomain()->BindAssemblySpecForIntrospectionDependencies(&spec);
-    }
-    else
-#endif //FEATURE_REFLECTION_ONLY_LOAD
     {
         PEAssemblyHolder pFile = GetDomainFile(GetAppDomain())->GetFile()->LoadAssembly(
                 kAssemblyRef, 
index 1dcab23..739c7dc 100644 (file)
@@ -1422,11 +1422,6 @@ FCFuncStart(gStreamFuncs)
     FCFuncElement("HasOverriddenBeginEndWrite", StreamNative::HasOverriddenBeginEndWrite)
 FCFuncEnd()
 
-#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD)
-FCFuncStart(gWindowsRuntimeMetadata)
-    QCFuncElement("nResolveNamespace", CLRPrivTypeCacheReflectionOnlyWinRT::ResolveNamespace)
-FCFuncEnd()
-#endif //FEATURE_COMINTEROP && FEATURE_REFLECTION_ONLY_LOAD
 
 #ifdef FEATURE_COMINTEROP
 FCFuncStart(gWindowsRuntimeBufferHelperFuncs)
@@ -1690,9 +1685,6 @@ FCClassElement("WindowsRuntimeBufferHelper", "System.Runtime.InteropServices.Win
 #endif
 
 
-#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD)
-FCClassElement("WindowsRuntimeMetadata", "System.Runtime.InteropServices.WindowsRuntime", gWindowsRuntimeMetadata)
-#endif
 
 #if defined(FEATURE_EVENTSOURCE_XPLAT)
 FCClassElement("XplatEventLogger", "System.Diagnostics.Tracing", gEventLogger)
index e19002e..dad0126 100644 (file)
 #include "multicorejit.h"
 #endif
 
-#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD)
-#include "clrprivtypecachereflectiononlywinrt.h"
-#endif
-
 #ifdef FEATURE_COMINTEROP
 #include "windowsruntimebufferhelper.h"
 #endif
index 97b0118..a824627 100644 (file)
@@ -76,9 +76,6 @@ DEFINE_FIELD_U(AssemblyLoad,               AppDomainBaseObject, m_pAssemblyEvent
 DEFINE_FIELD_U(_TypeResolve,               AppDomainBaseObject, m_pTypeEventHandler)
 DEFINE_FIELD_U(_ResourceResolve,           AppDomainBaseObject, m_pResourceEventHandler)
 DEFINE_FIELD_U(_AssemblyResolve,           AppDomainBaseObject, m_pAsmResolveEventHandler)
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-DEFINE_FIELD_U(ReflectionOnlyAssemblyResolve,  AppDomainBaseObject, m_pReflectionAsmResolveEventHandler)
-#endif
 #ifdef FEATURE_REMOTING
 DEFINE_FIELD_U(_DefaultContext,            AppDomainBaseObject, m_pDefaultContext)
 #endif
@@ -103,13 +100,6 @@ DEFINE_METHOD(APP_DOMAIN,           ON_ASSEMBLY_LOAD,       OnAssemblyLoadEvent,
 DEFINE_METHOD(APP_DOMAIN,           ON_RESOURCE_RESOLVE,    OnResourceResolveEvent,     IM_Assembly_Str_RetAssembly)
 DEFINE_METHOD(APP_DOMAIN,           ON_TYPE_RESOLVE,        OnTypeResolveEvent,         IM_Assembly_Str_RetAssembly)
 DEFINE_METHOD(APP_DOMAIN,           ON_ASSEMBLY_RESOLVE,    OnAssemblyResolveEvent,     IM_Assembly_Str_RetAssembly)
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-DEFINE_METHOD(APP_DOMAIN,           ON_REFLECTION_ONLY_ASSEMBLY_RESOLVE, OnReflectionOnlyAssemblyResolveEvent, IM_Assembly_Str_RetAssembly) 
-#ifdef FEATURE_COMINTEROP
-DEFINE_METHOD(APP_DOMAIN,           ON_REFLECTION_ONLY_NAMESPACE_RESOLVE, OnReflectionOnlyNamespaceResolveEvent, IM_Assembly_Str_RetArrAssembly)
-#endif //FEATURE_COMINTEROP
-DEFINE_METHOD(APP_DOMAIN,           ENABLE_RESOLVE_ASSEMBLIES_FOR_INTROSPECTION, EnableResolveAssembliesForIntrospection, IM_Str_RetVoid)
-#endif //FEATURE_REFLECTION_ONLY_LOAD
 #ifdef FEATURE_COMINTEROP
 DEFINE_METHOD(APP_DOMAIN,           ON_DESIGNER_NAMESPACE_RESOLVE, OnDesignerNamespaceResolveEvent, IM_Str_RetArrStr)
 #endif //FEATURE_COMINTEROP
index b76d09b..d5fb903 100644 (file)
@@ -2137,9 +2137,6 @@ class AppDomainBaseObject : public MarshalByRefObjectBaseObject
     OBJECTREF    m_pTypeEventHandler;     // Delegate for 'resolve type' event
     OBJECTREF    m_pResourceEventHandler; // Delegate for 'resolve resource' event
     OBJECTREF    m_pAsmResolveEventHandler; // Delegate for 'resolve assembly' event
-#ifdef FEATURE_REFLECTION_ONLY_LOAD
-    OBJECTREF    m_pReflectionAsmResolveEventHandler; //Delegate for 'reflection resolve assembly' event
-#endif    
 #ifdef FEATURE_REMOTING
     OBJECTREF    m_pDefaultContext;     // Default managed context for this AD.
 #endif