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

Fixing CalendarDatePicker's template #881

Merged
merged 3 commits into from
Jun 27, 2019

Conversation

llongley
Copy link
Member

CalendarDatePicker's default template currently references two properties added in later versions of XAML without using conditional XAML. This adds conditional XAML to the template in those cases.

@llongley llongley requested a review from a team as a code owner June 14, 2019 21:45
@jevansaks
Copy link
Member

While we're here, is there a way to make warnings-as-errors for the MUX solution so we don't introduce these again?

@chrisglein
Copy link
Member

While we're here, is there a way to make warnings-as-errors for the MUX solution so we don't introduce these again?

Was this manifesting as test failures? Runtime warnings?

@llongley
Copy link
Member Author

@jevansaks @chrisglein It's showing up in VS as error WMC0151. I can't seem to find any way to turn that warning into an error - the warning-as-errors directive /wennnn only appears to apply to warnings prefixed with C (which I think are C++ compiler warnings?).

Do you know if there's a way to do the same thing for XAML warnings? I'm coming up empty, and a search for "WMC warnings Visual Studio" or similar turned up absolutely nothing.

@jevansaks
Copy link
Member

Do you know if there's a way to do the same thing for XAML warnings? I'm coming up empty, and a search for "WMC warnings Visual Studio" or similar turned up absolutely nothing.

@danzil Any ideas on this?

@danzil
Copy link

danzil commented Jun 24, 2019

There's no such feature that I know of - that will turn XAML Warnings into Errors (when enabled). It may be possible to write an after-build targets that will look at the warnings emitted and raise an error if needed. We could also take this a feature request and create proper support for it in the Xaml Compiler targets, if there's enough interest.

@mdtauk
Copy link
Contributor

mdtauk commented Jun 24, 2019

Roslyn?

@llongley
Copy link
Member Author

@danzil Do you have any examples for after-build targets that alter the warnings/errors reported? I didn't actually know you could do that in a target.

@mdtauk I'm not too familiar with Roslyn, but isn't it specifically for C# and VB? This is a warning returned by the XAML compiler.

@danzil
Copy link

danzil commented Jun 27, 2019

@danzil Do you have any examples for after-build targets that alter the warnings/errors reported? I didn't actually know you could do that in a target.

I do not have an example. My recommendation was based on a purely theoretical example. I can't tell exacly how you would do that without actually trying to do it. :-)

Finally, adding a comment regarding what the warnings are that we're surfacing as errors.
@llongley
Copy link
Member Author

@jevansaks @danzil So it turns out that there's actually an MSBuild feature as of 15.3 that I've only just now heard about, in which you can just turn an arbitrary warning into an error (or into a message), regardless of origin, instead of relying on the C++ compiler's /we syntax:

dotnet/msbuild#1928

I tested this out and this does exactly what we wanted, so I've added that to this change.

@llongley llongley merged commit 04b119d into master Jun 27, 2019
@llongley llongley deleted the user/llongley/FixCalendarDatePickerDownlevel branch June 27, 2019 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants