[xabt] Use Load() in RunPipeline instead of pre-loading all assemblies#11250
Open
jonathanpeppers wants to merge 1 commit intomainfrom
Open
[xabt] Use Load() in RunPipeline instead of pre-loading all assemblies#11250jonathanpeppers wants to merge 1 commit intomainfrom
jonathanpeppers wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates AssemblyModifierPipeline to avoid eager pre-loading of all ResolvedAssemblies (which can trigger netstandard.dll resolution failures), and instead load each assembly from its exact path at the point it’s processed.
Changes:
- Stop pre-loading every
ResolvedAssembliesitem into the resolver cache during resolver setup. - In
RunPipeline, load assemblies viaresolver.Load(source.ItemSpec)(path-based) instead ofGetAssembly(name-based).
The pre-loading approach in #11208 eagerly loads ALL ResolvedAssemblies into the resolver cache. If any of those assemblies reference netstandard.dll (e.g. netstandard2.1 NuGet packages), Cecil lazy reference resolution will fail with FileNotFoundException since netstandard.dll is not in the search directories. Instead, use resolver.Load(source.ItemSpec) in RunPipeline to load each assembly from its exact path when processed. This ensures the correct TFM version is loaded without eagerly loading all assemblies upfront. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
28db7c4 to
443aff7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #11208.
The pre-loading approach eagerly loads ALL
ResolvedAssembliesinto the resolver cache viaresolver.Load(). If any of those assemblies referencenetstandard.dll(e.g.netstandard2.1NuGet packages), Cecil's lazy reference resolution will fail withFileNotFoundExceptionsincenetstandard.dllis not in the search directories.This was discovered while backporting #11208 to
release/10.0.1xx(#11248), where AppCompat dependencies still targetnetstandard2.1. Whilemaindoesn't currently hit this, it's a latent bug — any future dependency that referencesnetstandardwould trigger the same failure.Fix: Use
resolver.Load(source.ItemSpec)inRunPipelineto load each assembly from its exact path when it's processed, rather than pre-loading all assemblies upfront. This ensures the correct TFM version is loaded (the original goal of #11208) without the side effects of eager loading.