dotnet / dotnet/project-system
New Property Pages: Switching dimensional properties between varied/unvaried states causes non-project file values to be written, causes self-referencing string expression duplication
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
#### Summary
Some strings contain expressions. These expression-based strings are shown in the editing fields. However, these expressions don't exist in the project file and likely come from the SDK. For strings that have dimensions (configuration, platform, etc.), you can make the UI switch between varied and unvaried states. This will show a control per variation for each dimension of that property. However, switching from a varied state to unvaried will write the values of each variation into the project file. If that string expression references the property itself, this causes duplication of any terms beyond the expression part of the string.
#### Steps to Reproduce
1. Pick a string property that the SDK gives a self-referencing expression (such as `Conditional compilation symbols`). Observe the evaluated value (under the edit box).
2. Use the ⚙ to select `Vary value by Configuration`. This will split the edit box into one per variation of Configuration.
3. Use the ⚙ to select `Use the same value across all configurations`. This will change the UI back to a single edit field.
4. Observe that the evaluated value is now different from what it originally was.
5. Open the project file directly (double click on it) and observe the file now has the original string value written to it, once per each variation of Configuration.
#### Expected Behavior
Since the value was not edited, it should remain the same after flipping between `Vary value by Configuration` and `Use the same value across all configurations`. There should not be anything written to the project file.
#### Actual Behavior
The values of each variation of Configuration are written to the project file. This causes the evaluated value of the property to change since it uses a self-referencing expression.
#### Clip of Issue

Contributor guide
Assessment
This issue has not been assessed yet.