Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When at least one PackageReference project is used, inform when NuGet.exe restore is used and suggest using msbuild /t:restore to match with the build tooling #14146

Open
nkolev92 opened this issue Feb 26, 2025 · 0 comments
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Priority:2 Issues for the current backlog. Product:NuGet.exe NuGet.exe Type:DCR Design Change Request

Comments

@nkolev92
Copy link
Member

NuGet Product(s) Affected

NuGet.exe

Current Behavior

NuGet.exe project restore is fully supported in msbuild /t:restore, including packages.config.

https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#restoring-packagereference-and-packagesconfig-projects-with-msbuild

The benefit of using msbuild /t:restore is that you now only need to manage one set of tools. You don't need to bother updating.

Desired Behavior

An information or warning indicating you can use msbuild /t:restore.

Note that the warning's from NuGet.exe do not fail the build, so it can be added without a build failure.

https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-nuget-cli

Another idea would be a warning message when the projects are all SDK. In that cases, the .NET CLI can be used.

Additional Context

Nuget.exe knows all the projects in a solution, so we can easily figure out which tool to recommend based on the list of projects we're restoring.

@nkolev92 nkolev92 added Triage:Untriaged Type:DCR Design Change Request Product:NuGet.exe NuGet.exe Area:ErrorHandling warnings and errors/log messages & related error codes. Priority:2 Issues for the current backlog. and removed Triage:Untriaged labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Priority:2 Issues for the current backlog. Product:NuGet.exe NuGet.exe Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

1 participant