Skip to content

Don't use obsolete NuGet ExtractFile API in SDK tests - #10820

Merged
akoeplinger merged 2 commits into
mainfrom
akoeplinger-investigate-build-1670337
Nov 9, 2026
Merged

akoeplinger merged 2 commits into
mainfrom
akoeplinger-investigate-build-1670337

Conversation

@akoeplinger

@akoeplinger akoeplinger commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Enable SDK test builds on non-Windows in the VMR BuildTests lane, and update ToolPack tests to use PackageArchiveReader.ExtractFile's path-validating overload. The previous overload was marked obsolete in NuGet/NuGet.Client#7827.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 09:56
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team November 9, 2026 09:56
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@akoeplinger akoeplinger changed the title Use safe NuGet extraction in SDK tests Don't use obsolete NuGet ExtractFile API in SDK tests Nov 9, 2026

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.

🔵 Needs a closer look

Compilation was blocked by an older restored NuGet.Packaging package, leaving the new overload calls and affected ToolPack tests unverified against the intended NuGet artifacts in a full VMR build.

No open issues 🎉

What changed in this PR

Updates SDK ToolPack tests to use NuGet’s path-validating PackageArchiveReader.ExtractFile overload for safer package extraction.

Changes:

  • Migrates six extraction calls across three test files.
  • Passes the destination directory and filename separately, preserving the intended output locations.
File Description
src/​sdk/​test/​Microsoft.NET.ToolPack.Tests/​GivenThatWeWantToPackAToolProjectWithPackagedShim.cs Updates shim and tool-layout asset extraction calls.
src/​sdk/​test/​Microsoft.NET.ToolPack.Tests/​GivenThatWeWantToPackAToolProjectWithExplicitConfig.cs Updates settings-file extraction in explicit-configuration tests.
src/​sdk/​test/​Microsoft.NET.ToolPack.Tests/​GivenThatWeWantToPackAToolProject.cs Updates settings-file extraction in package-content validation.

Review effort: Balanced

@akoeplinger

akoeplinger commented Nov 9, 2026 •

Copy link
Copy Markdown
Member Author

FYI @zivkan this didn't break the build in the VMR since we only built sdk tests on Windows (hence why the nuget FF was merged since PR builds only build on Ubuntu). Fixed that too.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@akoeplinger
akoeplinger requested review from a team as code owners November 9, 2026 10:04
@akoeplinger
akoeplinger merged commit e11e77b into main Nov 9, 2026
11 checks passed
@akoeplinger
akoeplinger deleted the akoeplinger-investigate-build-1670337 branch November 9, 2026 16:19
@akoeplinger

Copy link
Copy Markdown
Member Author

/backport to release/11.0.2xx

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.2xx (link to workflow run)

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