[Feature Request]: Warns a user if they use Restore as an explicit target (/t:Restore;Build) instead of the /restore flag
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Summary
We should warn users when they use the Restore target specifically (`-t:Restore`) instead of `/restore` during a build - this is _very often_ a mistake and we should point users to the correct version.
### Background and Motivation
Users of the new CLI-based MSBuild property/item syntax often run into issues with uninitialized repositories, so they add `-t:Restore` and then wonder why their tooling only works after the first run. This is the core reason, and we should guide them to using the switch.
### Proposed Feature
When
* Restore is part of the targets list, and
* a project contains NuGet packages, and
* a nuget dependency file was created during the build
* then issue a warning so the user knows they should use /restore instead of /t:Restore
### Alternative Designs
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.