Repository navigation
Backlog
Labels
Functionality:ListPackagedotnet.exe list packagePriority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.Type:Bug
Description
NuGet Product Used
dotnet.exe
Product Version
10.0.404
Worked before?
don't think so
Impact
It bothers me. A fix would be nice
Repro Steps & Context
My solutions have several configurations
dotnet package list --vulnerable --include-transitive only works with a configuration named Debug
I have a CI configuration which includes all tests and a Debug configuration that does not include any tests
In my audit pipeline, I restore then check for vulnerable nugets
As intended, dotnet restore ignore the tests projects.
dotnet package list does not ignore them and will display a Assets file not found
Expected behavior:
dotnet package list should ignore those projects
Workaround:
Enabling all tests projects in the Debug configuration but it is not what Debug is intended for
Verbose Logs
dotnet restore
La génération a démarré 25/11/2026 12:03:12.
1>Projet "D:\Agent\_work\3\s\Ldap.Api.slnx" sur le nœud 1 (Restore cible(s)).
1>ValidateSolutionConfiguration:
Génération de la configuration de solution "Debug|x64".
ValidateProjects:
Le projet "IntegrationTests" n'est pas sélectionné dans le cadre d'une génération dans la configuration de solution "Debug|x64".
Le projet "NonFunctionalTests" n'est pas sélectionné dans le cadre d'une génération dans la configuration de solution "Debug|x64".
Le projet "UnitTests" n'est pas sélectionné dans le cadre d'une génération dans la configuration de solution "Debug|x64".
dotnet package list
Fichier de ressources introuvable pour `D:\\Agent\_work\3\s\FunctionalTests\FunctionalTests.csproj`. Effectuez une restauration avant d’exécuter cette commande.
Les sources suivantes ont été utilisées :
https://api.nuget.org/v3/index.json
Le projet spécifié 'Api' n'a aucun package vulnérable compte tenu des sources actuelles.
[...]Metadata
Metadata
Assignees
Labels
Functionality:ListPackagedotnet.exe list packagePriority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.Type:Bug
Activity
jeffkl commentedon Nov 25, 2026
Triage
Valid bug in
dotnet package list. Solution restore respects the selected configuration, but package listing enumerates every project in the solution—including projects excluded from that configuration. If an excluded project has no assets file, the command reportsAssets file not foundand exits with code 1.I reproduced this with the reported vulnerability options on .NET SDK 11.0.100. I could not verify the behavior on the reported .NET SDK 10.0.404.
Workaround
Create a solution filter (
.slnf) containing only the projects to audit, then run:This succeeded in the repro. The filter will need to be maintained as the desired audit scope changes.
Fix direction
Align project selection with the solution configuration used for restore, and support selecting the configuration and platform consistently during restore and project evaluation. Changing the default audit scope needs a compatibility decision.
Relevant code:
ListPackageCommandRunner.cs— enumerates projects from the solution.MSBuildAPIUtility.cs— currently returns all solution projects for.slnand.slnxfiles.The CLI implicitly restores by default starting with .NET 10: dotnet package list restore behavior.