dotnet / dotnet/project-system

Determine general solution for properties that have no initial value

Open
#7,360 2 comments 0 reactions 0 assignees View on GitHub
Feature-Project-Properties-Designer Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

Originally from here: https://github.com/dotnet/project-system/issues/6989
In some cases, evaluated properties are not set. They will have no value (never defined) by the time they get to us. This can happen to any property but the example property is `Nullable`. In the dropdown for this property, no value will be selected because it was never defined. However, there is a logical default value used in the framework for this property since it changes how the build works.

One solution is to simply set property interceptors for each situation this occurs, but that seems overly verbose. It also has the potential of becoming out-of-sync with the actual framework's default logic (however, that's unlikely). One solution I like based on my past experience is making a way in the XAML rule file to set a default value. In Azure SDKs, we called this a **client-side default** since the server didn't provide a value for us, just like MSBuild not having this property defined. It was named this way to differentiate between server-side defaults, which is what a server provides when you (client) don't provide a value. I think this would be the best solution for us since it is easy to update for any properties with this issue. Plus, it has general use outside of our property pages, for anyone else in CPS using this implementation.

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.