Skip to content

dotnet list package --format=json outputs warning "(A) : Auto-referenced package." #13080

@KalleOlaviNiemitalo

Description

@KalleOlaviNiemitalo

NuGet Product Used

dotnet.exe

Product Version

.NET SDK 8.0.100

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

  1. dotnet new classlib --framework netstandard2.0
  2. dotnet list package --format=json --output-version=1

The output is:

{
  "version": 1,
  "parameters": "",
  "problems": [
    {
      "level": "warning",
      "text": "(A) : Auto-referenced package."
    }
  ],
  "projects": [
    {
      "path": "C:/Users/Kalle/AppData/Local/Temp/PkgDemo/PkgDemo.csproj",
      "frameworks": [
        {
          "framework": "netstandard2.0",
          "topLevelPackages": [
            {
              "id": "NETStandard.Library",
              "requestedVersion": "[2.0.3, )",
              "resolvedVersion": "2.0.3",
              "autoReferenced": "true"
            }
          ]
        }
      ]
    }
  ]
}

In the "problems" array, there is a warning "(A) : Auto-referenced package." This warning is useless and should not be output, because:

  • Auto-referencing a package is a normal situation, not something that should be warned about.
  • The warning seems intended as a legend for the "(A)" notation, but the JSON output does not use that notation.
  • The JSON output includes "autoReferenced" as a per-package property. Software that cares about auto-referenced packages can read that property and won't need the warning.

Verbose Logs

dotnet list package --format=json --output-version=1 --verbosity diag does not output anything more than the same command without --verbosity diag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions