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 t/bug Something isn't working
Milestone

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

@StephaneDelcroix StephaneDelcroix linked a pull request Jan 24, 2024 that will close this issue
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 7, 2024
@samhouts samhouts added the t/bug Something isn't working label Jul 31, 2024
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 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants