Repository navigation
Don't use obsolete NuGet ExtractFile API in SDK tests - #10820
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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. |
Contributor
There was a problem hiding this comment.
🔵 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
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>
ViktorHofer
approved these changes
Nov 9, 2026
Member
Author
|
/backport to release/11.0.2xx |
Contributor
|
Started backporting to |
This was referenced Nov 10, 2026
This was referenced Nov 14, 2026
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.
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.