Repository navigation
Escape localized restore errors in package list JSON - #57083
Merged
zivkan merged 1 commit intoNov 13, 2026
Merged
Conversation
Encode localized problem text as a JSON string and test restore failures across command forms and locales. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1f376772-430b-4c25-8b99-48310010d579
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 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.
🟢 Approval recommended
No active review issues were identified for the change that escapes localized restore-error text in JSON output.
No open issues 🎉
What changed in this PR
Fixes invalid JSON in the .NET CLI’s package-list restore errors when localized messages contain double quotes, addressing #57063.
Changes:
- JSON-encodes localized restore error text while preserving the existing output structure.
- Adds four regression cases covering both command forms and Portuguese (Brazil), German, and English locales, checking JSON validity and localized message content.
| File | Description |
|---|---|
test/dotnet.Tests/CommandTests/Package/List/GivenDotnetListPackage.cs |
Adds regression coverage for localized restore failures in JSON output. |
src/Cli/dotnet/Commands/Package/List/PackageListCommand.cs |
Escapes localized error text before inserting it into JSON. |
Review effort: Balanced
This was referenced Nov 12, 2026
nkolev92
approved these changes
Nov 12, 2026
zivkan
had a problem deploying
to
copilot-pat-pool
November 13, 2026 20:52 — with
GitHub Actions
Failure
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:53 — with
GitHub Actions
Inactive
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:53 — with
GitHub Actions
Inactive
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:53 — with
GitHub Actions
Inactive
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:55 — with
GitHub Actions
Inactive
Member
|
/backport to release/11.0.1xx |
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:57 — with
GitHub Actions
Inactive
Contributor
|
Started backporting to |
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:59 — with
GitHub Actions
Inactive
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:59 — with
GitHub Actions
Inactive
zivkan
temporarily deployed
to
copilot-pat-pool
November 13, 2026 20:59 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Fix invalid package-list JSON when localized restore errors contain quotes.
Testing: Four regression cases passed across both command forms and three locales using an isolated SDK overlay.
Fixes: NuGet/Home#15140
Fixes: #57063