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

[X] Consider producing build errors when XAML compilation is bypassed and XAML parsing at runtime is disabled #19647

Open
simonrozsival opened this issue Jan 2, 2024 · 1 comment · May be fixed by #20127
Assignees
Labels
area-xaml XAML, CSS, Triggers, Behaviors

Comments

@simonrozsival
Copy link
Member

simonrozsival commented Jan 2, 2024

The motivation is to prevent hitting XAML parsing codepaths at runtime when it is disabled and these codepaths would throw runtime exceptions (see #19310):

  • disabling XAML compilation using <?xaml-comp compile="false" ?> should cause a build failure
  • [XamlCompilation(XamlCompilationOptions.Skip)] on any class, module or assembly should cause build failure
  • setting $(MauiXamlCValidateOnly)=true in Release should cause build failure
  • any binding which can't be compiled should cause build failure
    • this has been partially covered by [X] Warn on non compiled bindings #19360 but we would also need to make sure all bindings with relative binding sources can be compiled (currently not implemented AFAIK)

If there are other cases in which it is possible to skip XAML compilation, they should cause build failures as well.

/cc @StephaneDelcroix

@simonrozsival simonrozsival added the area-xaml XAML, CSS, Triggers, Behaviors label Jan 2, 2024
@StephaneDelcroix StephaneDelcroix self-assigned this Jan 12, 2024
@simonrozsival
Copy link
Member Author

simonrozsival commented Jan 23, 2024

  • setting $(MauiXamlCValidateOnly) should fail only in Release or when $(IsTrimming)=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-xaml XAML, CSS, Triggers, Behaviors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants