Include resources in command line arguments produced by csc in design-time build (take 2)#11949
Merged
YuliiaKovalova merged 2 commits intodotnet:mainfrom Jul 8, 2025
Merged
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the design-time build by ensuring resource items carry an explicit output path before code generation runs.
- Introduce a new
AssignEmbeddedResourceOutputPathstarget and wire it into thePrepareResourceNamesDependsOnsequence. - Refactor
OutputResourcesto use the newly assigned%(OutputResource)metadata. - Add a dependency for
_GenerateCompileInputsonPrepareResourceNamesto guarantee metadata is set.
Comments suppressed due to low confidence (2)
src/Tasks/Microsoft.Common.CurrentVersion.targets:3255
- There are no automated tests covering the new
AssignEmbeddedResourceOutputPathstarget. Consider adding unit or integration tests to verify thatOutputResourcemetadata is correctly set for EmbeddedResource items.
<Target Name="AssignEmbeddedResourceOutputPaths">
src/Tasks/Microsoft.Common.CurrentVersion.targets:3253
- [nitpick] The XML comment could be expanded to note which downstream targets rely on this metadata (e.g.,
_GenerateCompileInputsandGetItemTargetPaths), improving clarity for future maintainers.
Sets OutputResource metadata on EmbeddedResource items. This metadata is used in design time build without running ResGen target.
YuliiaKovalova
approved these changes
Jun 5, 2025
Member
|
Looks ok to me but should we test it in the VMR too since it broke there? |
Member
Author
|
@rainersigwald How do I do that? |
Member
|
Create a draft PR with this same content in |
Member
Author
|
Validation PR: dotnet/dotnet#987 |
SimaTian
approved these changes
Jul 8, 2025
Member
Author
|
Oh, wait ... this was still broken. I had to tweak the code in the validation PR. Let me submit a fix... |
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.
Iteration on #11893, which had to be reverted.
Adds condition to only update
OutputResourceif it is not set already.