Skip to content

Detect and warn when users consume OutputPath in Project files directly #41852

Open
@baronfel

Description

@baronfel

Is your feature request related to a problem? Please describe.

There are many properties that are set by the SDK by default, but the SDK defers computing them until .targets files are evaluated to give users a chance to set these properties in .props and project files.

However, users also often read these properties directly in props/project files, leading to scenarios where a property defined in a project file has an incorrect value after the rest of the SDK targets have run. A common property used in this way is OutputPath.

It's common to want to compute a path for some output that will live in the OutputPath of the project, but that final path isn't known until the SDK's DefaultOutputPath targets run. This means the best way for a user to set properties that use OutputPath is to create a Target, tie that Target into the build, and then define their property just before usage.

We should detect the direct usage of properties in project files that are only set later in the SDK and warn users that the values may not be usable or trustworthy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions