public MyAssemblyResolver(LoadedAssembly parent, AssemblyListSnapshot assemblyListSnapshot, bool loadOnDemand, bool applyWinRTProjections) { this.parent = parent; this.loadOnDemand = loadOnDemand; this.applyWinRTProjections = applyWinRTProjections; this.providedAssemblyResolver = parent.providedAssemblyResolver; this.assemblyList = parent.assemblyList; // Note: we cache a copy of the assembly list in the constructor, so that the // resolve calls only search-by-asm-name in the assemblies that were already loaded // at the time of the GetResolver() call. this.alreadyLoadedAssemblies = assemblyListSnapshot; // If we didn't do this, we'd also search in the assemblies that we just started to load // in previous Resolve() calls; but we don't want to wait for those to be loaded. this.tfmTask = parent.GetTargetFrameworkIdAsync(); this.referenceLoadInfo = parent.LoadedAssemblyReferencesInfo; }
internal static IAssemblyResolver GetAssemblyResolver(this PEFile file, AssemblyListSnapshot snapshot, bool loadOnDemand = true) { return(GetLoadedAssembly(file).GetAssemblyResolver(snapshot, loadOnDemand)); }
internal IAssemblyResolver GetAssemblyResolver(AssemblyListSnapshot snapshot, bool loadOnDemand = true, bool applyWinRTProjections = false) { return(new MyAssemblyResolver(this, snapshot, loadOnDemand, applyWinRTProjections)); }