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
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
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.
The text was updated successfully, but these errors were encountered: