Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine general solution for properties that have no initial value #7360

Open
MiYanni opened this issue Jun 24, 2021 · 2 comments
Open

Determine general solution for properties that have no initial value #7360

MiYanni opened this issue Jun 24, 2021 · 2 comments
Labels
Feature-Project-Properties-Designer The new project property pages which replace the legacy AppDesigner Triage-Investigate Reviewed and investigation needed by dev team
Milestone

Comments

@MiYanni
Copy link
Member

MiYanni commented Jun 24, 2021

Originally from here: #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.

@MiYanni MiYanni added the Feature-Project-Properties-Designer The new project property pages which replace the legacy AppDesigner label Jun 24, 2021
@tmeschter
Copy link
Contributor

tmeschter commented Jun 24, 2021

The XAML Rule files already provide a way to specify a default value, via BaseProperty.Default. We just don't make use of it--we neither set it in our .xaml files, nor read it anywhere.

The downside to this approach is that if the logical default changes we have to know to go back and update our .xaml files. The ideal approach is to work with other teams to get reasonable defaults defined in the imported .props and .targets files. However, that won't always be possible, so I do think we should pursue this as a back-up option.

@drewnoakes
Copy link
Member

Also the default can vary by target framework, for example.

You mention defaults are unlikely to change over time, but I do not believe that can be discounted so quickly.

@jjmew jjmew added this to the 17.x milestone Jun 29, 2021
@jjmew jjmew added the Triage-Investigate Reviewed and investigation needed by dev team label Jun 29, 2021
@MiYanni MiYanni removed their assignment May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Project-Properties-Designer The new project property pages which replace the legacy AppDesigner Triage-Investigate Reviewed and investigation needed by dev team
Projects
None yet
Development

No branches or pull requests

4 participants