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

Open
#7,050 1 comment 0 reactions 1 assignee Assigned to @drewnoakes View on GitHub
Feature-Project-Properties-Designer Triage-Approved
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
![EvaluatedStringDuplicationIssue](https://user-images.githubusercontent.com/17788297/112545416-6cbdcc00-8d75-11eb-81c6-c87de8382a7b.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.