Skip to content

ProjectItemLink does not provide InheritedItemTypeDefinition #12491

@lifengl

Description

@lifengl

Issue Description

The ProjectItemLink contract doesn't provide InheritedItemTypeDefinition (that concept is kept internal to MSBuild), this leads the ProjectItemInstance created based ProjectItemLink always has an empty ItemTypeDefinition list.

Because ProjectItemInstance computes metadata values based on direct metadata, item type definition and inherited item definition internally (not going through the Link layer), this missing link leads the metadata value from items created through msbuild expressions to be incorrect in the project cache mode.

To fix that, ProjectItemLink need have a new virtual method to allow the link side to provide this list. (It would be nicer if it also provides API for the link implementation side to read this list from project evaluation).

Steps to Reproduce

No log, this is a bug in contract design.

Expected Behavior

extension can provide InheritedItemTypeDefinitions.

Actual Behavior

The current contract does not.

Analysis

No response

Versions & Configurations

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions