dotnet / dotnet/project-system
IProjectProperties contains no API for getting a property value with dimensional conditions
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
The [IProjectProperties interface](http://index/?rightProject=Microsoft.VisualStudio.ProjectSystem&file=ProjectProperties%5CIProjectProperties.cs&line=89) contains a function which allows you to set a property value for some dimensional conditions:
`Task SetPropertyValueAsync(string propertyName, string unevaluatedPropertyValue, IReadOnlyDictionary? dimensionalConditions = null);`
However, there is no symmetric function that allows us to get a property value under specific dimensional conditions.
I was expecting something like this to exist and was surprised to learn it doesn't:
`Task GetEvaluatedPropertyValueAsync(string propertyName, IReadOnlyDictionary? dimensionalConditions = null);`
## User Impact
I've encountered a scenario where I need to read/write a property value to the project file for some non-standard dimensional conditions (`"$(RunConfiguration)=='Default'"`) within an intercepting value provider.
I'm able to write just fine using the API mentioned above, but to read from the project file I currently need to use [IProjectLockService](http://index/?rightProject=Microsoft.VisualStudio.ProjectSystem&file=Core%5cProjectLock%5cIProjectLockService.cs&line=96) which allows me to directly parse the xml.
This works fine for now, but it would be much simpler if we could just call Get(Un)EvaluatedPropertyValueAsync with dimensional conditions.
Contributor guide
Assessment
This issue has not been assessed yet.