Skip to content

[Feature Request]: Warns a user if they use Restore as an explicit target (/t:Restore;Build) instead of the /restore flag #9690

@baronfel

Description

@baronfel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions