Use StaticWebAsset.NormalizeContentRootPath TaskEnvironment overload in CollectStaticWebAssetsToCopy - #54867
#54867Merged
jankratochvilcz merged 1 commit intoJun 18, 2026
dotnet:maindotnet/sdk:mainfrom
jankratochvilcz:swa-collect-copy-use-normalize-overloadjankratochvilcz/sdk:swa-collect-copy-use-normalize-overloadCopy head branch name to clipboard
Merged
Use StaticWebAsset.NormalizeContentRootPath TaskEnvironment overload in CollectStaticWebAssetsToCopy#54867jankratochvilcz merged 1 commit intodotnet:maindotnet/sdk:mainfrom jankratochvilcz:swa-collect-copy-use-normalize-overloadjankratochvilcz/sdk:swa-collect-copy-use-normalize-overloadCopy head branch name to clipboard
jankratochvilcz merged 1 commit into
dotnet:maindotnet/sdk:mainfrom
jankratochvilcz:swa-collect-copy-use-normalize-overloadjankratochvilcz/sdk:swa-collect-copy-use-normalize-overloadCopy head branch name to clipboard
Conversation
Simplify CollectStaticWebAssetsToCopy by calling the existing NormalizeContentRootPath(string, TaskEnvironment) overload instead of manually resolving OutputPath through TaskEnvironment.GetAbsolutePath. Addresses review feedback on dotnet#54621. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Static Web Assets MSBuild task CollectStaticWebAssetsToCopy to use the existing StaticWebAsset.NormalizeContentRootPath(string path, TaskEnvironment env) overload, keeping OutputPath normalization consistent with other TaskEnvironment-aware path handling.
Changes:
- Replace inline
TaskEnvironment.GetAbsolutePath(OutputPath)logic with a call toNormalizeContentRootPath(OutputPath, TaskEnvironment).
OvesN
approved these changes
Jun 18, 2026
jankratochvilcz
enabled auto-merge (squash)
June 18, 2026 16:34
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 #54621.
Veronika (review comment) noted that we already have a
StaticWebAsset.NormalizeContentRootPath(string path, TaskEnvironment env)overload, so the call site doesn't need to inline theTaskEnvironment.GetAbsolutePathresolution.This simplifies:
to:
The overload performs the exact same null/empty guard and
GetAbsolutePathresolution internally, so behavior is unchanged.Validation
./.dotnet/dotnet build src/StaticWebAssetsSdk/Tasks/Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj -c Debug