dotnet / dotnet/msbuild

ProjectItemLink does not provide InheritedItemTypeDefinition

Open
#12,491 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.