Skip to content

dotnet list package --format json generates invalid JSON output on error in PT-BR translation #57063

Closed

Description

@rhrocha

Describe the bug

The command dotnet list package --format json generates invalid JSON with non-espaced double quotes in error message when the dotnet restore fails. The "text" property contains non-escaped literal double quotes, so the JSON parsing fails.

Steps to reproduce

Inside an empty folder, create an empty .csproj file and run the command dotnet list package --format json

Expected behavior

Output message in english:

{ "version": 1, "problems": [ { "text": "Restore failed. Run `dotnet restore` for more details on the issue.", "level": "error" } ] }

Output with PT-BR localized text:

{ "version": 1, "problems": [ { "text": "Falha na restauração. Execute `dotnet restore` para obter mais detalhes sobre o problema.", "level": "error" } ] }

Actual behavior

Output with PT-BR localized text:

{ "version": 1, "problems": [ { "text": "Falha na restauração. Execute "dotnet restore" para obter mais detalhes sobre o problema.", "level": "error" } ] }

The double quotes instead of backticks around dotnet restore are breaking the JSON syntax.

Is this a regression?

No response

Are there any workarounds?

No response

dotnet --info output

IDE version

Visual Studio v18.12

Other details

No response

Activity

  1. added
    untriaged
    on Nov 11, 2026
  2. locked and limited conversation to collaborators on Nov 11, 2026
  3. unlocked this conversation on Nov 11, 2026
  4. added
    cookie
    and removed
    untriaged
    on Nov 11, 2026
  5. github-actions commented on Nov 11, 2026

    @github-actions
    Contributor

    🎯 Agentic Issue Triage

    Triage Assessment:

    • 🏷️ Labels: Area-NuGet Bug cookie Issue Monster Loves Cookies!
    • 💻 Assignment: @zivkan | @dotnet/nuget-team
    • 🟩 Confidence: high - Issue directly concerns dotnet list package output, owned by the NuGet area.

    ➡️ Summary: dotnet list package --format json emits invalid JSON when the localized restore-failed message (PT-BR) contains unescaped double quotes. Follow up by fixing the localized resource or escaping the text.

    Generated by 🏷️ Issue Triage for #57063 · copilot · auto · ~14 AIC · ⌖ ~1 AIC · ⊞ 14.6K · ◷

  6. dotnet-policy-service commented on Nov 11, 2026

    @dotnet-policy-service
    Contributor

    Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue!

    If you believe this issue was closed out of error, please comment to let us know.

    Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-NuGetBugcookie

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions