Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use StaticWebAsset.NormalizeContentRootPath TaskEnvironment overload in CollectStaticWebAssetsToCopy - #54867

#54867
Merged
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
Jun 18, 2026
Merged

Use StaticWebAsset.NormalizeContentRootPath TaskEnvironment overload in CollectStaticWebAssetsToCopy#54867
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

@jankratochvilcz

Copy link
Copy Markdown
Contributor

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 the TaskEnvironment.GetAbsolutePath resolution.

This simplifies:

var normalizedOutputPath = StaticWebAsset.NormalizeContentRootPath(
    string.IsNullOrEmpty(OutputPath) ? OutputPath : TaskEnvironment.GetAbsolutePath(OutputPath).Value);

to:

var normalizedOutputPath = StaticWebAsset.NormalizeContentRootPath(OutputPath, TaskEnvironment);

The overload performs the exact same null/empty guard and GetAbsolutePath resolution internally, so behavior is unchanged.

Validation

  • ./.dotnet/dotnet build src/StaticWebAssetsSdk/Tasks/Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj -c Debug

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>
Copilot AI review requested due to automatic review settings June 18, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to NormalizeContentRootPath(OutputPath, TaskEnvironment).

@jankratochvilcz
jankratochvilcz requested a review from OvesN June 18, 2026 16:09
@jankratochvilcz
jankratochvilcz enabled auto-merge (squash) June 18, 2026 16:34
@jankratochvilcz
jankratochvilcz merged commit 2da4e44 into dotnet:main Jun 18, 2026
26 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.