[release/9.0-staging] Fix getting resource when ResourceResolve returns assembly with resource that is an assembly ref#112893
Merged
elinor-fung merged 1 commit intodotnet:release/9.0-stagingfrom Feb 27, 2025
Conversation
…rce that is an assembly ref (dotnet#112810) When getting a resource where `ResourceResolve` handler returns an assembly with a manifest resource that is an assembly ref, we incorrectly resolved the reference on the original assembly instead of the assembly returned by the handler and then also looked for the resource on the original assembly again instead of using the referenced assembly. This change includes a test for this case using IL. The manifest resource file (as opposed to assembly ref) case is already covered in libraries tests.
Contributor
There was a problem hiding this comment.
Copilot reviewed 1 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (5)
- src/coreclr/vm/peassembly.cpp: Language not supported
- src/tests/Loader/ResourceResolve/ManifestResourceAssemblyRef.il: Language not supported
- src/tests/Loader/ResourceResolve/ManifestResourceAssemblyRef.ilproj: Language not supported
- src/tests/Loader/ResourceResolve/ResourceAssembly.csproj: Language not supported
- src/tests/Loader/ResourceResolve/ResourceResolve.csproj: Language not supported
Comments suppressed due to low confidence (2)
src/tests/Loader/ResourceResolve/ResourceResolve.cs:41
- [nitpick] The variable name 'expectedBytes' is ambiguous. It should be renamed to 'expectedResourceBytes' to better reflect its purpose.
Span<byte> expectedBytes = new byte[expected.Length];
src/tests/Loader/ResourceResolve/ResourceResolve.cs:43
- [nitpick] The variable name 'streamBytes' is ambiguous. It should be renamed to 'actualResourceBytes' to better reflect its purpose.
Span<byte> streamBytes = new byte[stream.Length];
jeffschwMSFT
approved these changes
Feb 25, 2025
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. please get a code review. we will take for consideration in 9.0.x
AaronRobinsonMSFT
approved these changes
Feb 25, 2025
6a30014
into
dotnet:release/9.0-staging
104 of 107 checks passed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of #112810
Fixes #111537
Customer Impact
Reported in #111537 - Stack overflow on resolving a resource via
ResourceResolvefor an assembly with an assembly ref manifest resource.When getting a resource where
ResourceResolvehandler returns an assembly with a manifest resource that is an assembly ref, we incorrectly resolved the reference on the original assembly instead of the assembly returned by the handler and then also looked for the resource on the original assembly again instead of using the referenced assembly.Regression
Regression in .NET 9 from eae1542.
Testing
Added automated test for manifest resource assembly ref. The manifest resource file (as opposed to assembly ref) case is already covered in libraries tests.
Risk
Low.