Skip to content

MSBuild ITaskItem/TaskItem should be able to report an IElementLocation or similar to aid diagnostics #13487

@baronfel

Description

@baronfel

Summary

Today ITaskItem/ITaskItem[] passed into a Task do not carry Location information, which means that when reporting diagnostics based on the content of those ITaskItems the Task cannot directly point the user to the source of the diagnostic. This makes it hard to trace faults for things like malformed PackageVersion Items, or typo'd PackageReferences.

Background and Motivation

We want to enable Task authors to efficiently point users to the source of problems to speed up the fix cycle.

Proposed Feature

We add a Location nullable member to our Task interfaces via a way that is to be designed, and we start populating that information on ITaskItem instances that are backed by actual XML elements in MSBuild logic files. Users that explicitly create TaskItem instances should also be able to set Location information.

Alternative Designs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: DebuggabilityIssues impacting the diagnosability of builds, including logging and clearer error messages.Priority:2Work that is important, but not critical for the releaseUser Experiencebacklogneeds-designRequires discussion with the dev team before attempting a fix.triaged
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions